plz help me to solve this problem... create a c++ program using while and for loop that will output:
x is not between 1 and 4
x is one
x is two
x is three
x is four
x is not between 1 and 4..
I don't understand you're trying to to.
If you want to print that, just do this:
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
int main()
{
cout << "x is not between 1 and 4\n""x is one\n""x is two\n""x is three\n""x is four\n""x is not between 1 and 4\n";
return 0;
}
No, that's not what your prof told you. Your prof told you to do this:
Write a program that does the following:
1) Reader user input into a variable x
2) Behave differently according to the value of x:
2.1) x=1: print "x is one".
2.2) x=2: print "x is two"
2.3) x=3: print "x is three"
2.4) x=4: print "x is four"
2.5) If neither of the above is true, print "x is not between 1 and 4"
3) Go back to 1