Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

Can someone tell me how to format this loop correctly ? if (month == 4 || month == 6 || month == 9 || month == 11) { maxDay = 30; } else (month == 2) { maxDay = 28; } else { maxDay = 31; }

OpenStudy (anonymous):

The first else should be 'else if' or 'elsif' or 'elif' depending on language. I am guessing c and 'else if'.

OpenStudy (anonymous):

yea it should be else if. But even if i put "else if" , the loop still doesnt work ...

OpenStudy (anonymous):

This seems to work http://codepad.org/cuBUwbbQ

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!