<iostream>
<cstdlib>
<ctime>

using namespace std;

int main() {
  int y, intentos=0;
  srand((unsigned)time(0));
    int x = rand()%100+1;

  do {

      cout << "Guess my number between 1 to 100"<<endl;
      cin >> y;


      if (y>x){
          cout << "I´m sorry, " << y << "The number is too big" << endl;
      }
          else if (y<x){
              cout << "I´m sorry, " << y << " The number is too small." << endl;
          }
              else if (y=x){
                  cout << "Congrats, the correct answer was " << x << endl;
              }


  } while (y!=x);

  return 0;
}

CC BY 4.0 #WSQ06 by Ever Ibarra Almaral is licensed under a Creative Commons Attribution 4.0 International License.