Hiya - I'm getting very confused with do-while loops, I'm trying to do a more complicated version of this but I know that if I get the hang of this I can do my propler program!
The problem is that no matter what number I initially enter it tells me that it is an odd number but then works after that!
Can anyone explain what I'm doing wrong please - I'm going crazy!
#include<iostream.h>
#include<Text.h>
//using namespace std;
int main()
{
int value;
cout << "enter even number" << endl;
cin >> value;
while (value%2==1) // if odd
do
{
cout << "that is an odd number try again";
cin >> value;
}
cout << endl << "that is correct"; // if even
return 0;
}