Code:
#include <iostream>
using namespace std;
int main (void)
{
int x;
x = 5;
int y;
int z;
while (x != y)
{
cout << "enter a number here: ";
cin >> y;
if (y == x)
cout << "yes, oh boy, you got it.";
else if (y > x)
cout << "no, ur wrong. It's lower. type 0 and press enter to try again.";
else
cout << "no, ur wrong. It's higher, type 0 and press enter to try again.";
cin >> y;
}
return 0;
}
this is what i have, similar to what you said josh, and smurfs is right. I think.
My next step is to ad a random function to X so it's not always 5, but looking around ive not found a simple way to have it be between 1 and 100. YOu can give me the code if you really feel like it or not...your choice.
is there a way to do do
is there a function in c++ that closes the window after completing requirement of sorts?