Hello, I tried making a guess my number game, but inverted, by having the user input a number and the computer trying to guess it.
Here is the source code.
//Guess my Number (inverted)
//The computer will guess your number
#include <iosteam>
#include <cstdlib>
#include <ctime>
usingnamespace std;
int main ()
{
int myNumber,;
string yesorno;
cout <<"Enter a number between 1 and 10: ";
cin >> myNumber;
cout <<"\nYou chose "<<myNumber <<" as your number."do
{
srand(time(0));
int theNumber = rand() % 10 + 1;
cout <<"Is your number "<<theNumber<<"?";
cin >> yesorno;
} while (yesorno == yes);
cout <<"I won !";
return 0;
}