Please have a look at this simple piece of c++ code i've been playing with.
#include <iostream>
using namespace std;
int main()
{
int num1, num2;
cout << "enter two numberS";
cin >> num1 >> num2;
while (num1 != 0 && num2 != 0)
{
cout << "try again";
cin >> num1 >> num2;
}
return 0;
}
It makes no sense....
the while loop exits when either variable = 0;
i've been fiddling with this for a while, and its driving me insane.
HELP
#include <iostream>
using namespace std;
int main()
{
int num1, num2;
cout << "enter two numberS";
cin >> num1 >> num2;
while (num1 != 0 && num2 != 0)
{
cout << "try again";
cin >> num1 >> num2;
}
return 0;
}
It makes no sense....
the while loop exits when either variable = 0;
i've been fiddling with this for a while, and its driving me insane.
HELP