// Guess My Number #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { //int t = time(0); srand(time(0)); int theNumber = rand() % 100 + 1; int tries = 0,guess; //cout<<t<<endl; cout << "/tWelcome to Guess My Number/n/n"; cout << "The number is hold in my hand !/n/n"; do { cout<<"Please enter a guess: "; cin>>guess; ++tries; if (guess>theNumber) { cout<<"Too high !/n/n"; } if (guess<theNumber) { cout<<"Too low !/n/n"; } } while (guess != theNumber); cout<<"that's it ! you got it in "<<tries<<" guesses !/n"; return 0 ; }