Ask your own question, for FREE!
Mathematics 21 Online
OpenStudy (bahrom7893):

Guys I need C++ help again..

OpenStudy (bahrom7893):

This is so weird, I can do the hard problems easily and I can't do the basic stuff..

OpenStudy (bahrom7893):

Anyway I'm trying to do this.. I want my program to accept anything right, but if they are not the following numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 I want the program to say try again.

OpenStudy (bahrom7893):

#include<iostream> using namespace std; int main() { int month; cout << "Please enter a month (1-12): "; cin >> month; while (month != 1 || month != 2 || month != 3 || month != 4 || month != 5 || month != 6 || month != 7 || month != 8 || month != 9 || month != 10 || month != 11 || month != 12) { cout << "An incorrect month has been entered, try again: "; cin >> month; break; } if (month == 1 || month == 2 || month == 3 || month == 4 || month == 5 || month == 6 || month == 7 || month == 8 || month == 9 || month == 10 || month == 11 || month == 12) cout << "A correct month has been entered."; system("pause"); return 0; } I'm trying to do this, but it's not doing what I want it to do..

OpenStudy (bahrom7893):

something like that.. can anyone fix it?

OpenStudy (bahrom7893):

ah forget it, i misread the assignment..

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!
Latest Questions
Breathless: Spooky witch but cute
3 hours ago 3 Replies 0 Medals
Arriyanalol: help
3 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 3 Medals
Jaded012023: Please tell me what you all think of this song
6 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
6 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
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!