#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int i=0, compnum=rand()%1000, guess;
char quit;
while (quit != 'y'){
cout << "The computer has guessed a number between 1 and 1000, try to guess the number: ";
cin >> guess;
while (guess != compnum){
if (guess < compnum){
cout << "\nThe amount you guessed is less than the number the computer chose, try again: ";
cin >> guess;
}//end if
else if (guess > compnum){
cout <<"\nThe amount you guessed is greater than the number the computer chose, try again: ";
cin >> guess;
}//End elseif
else {
break;
}//end else
}//end while
cout << "\nCongrats, you guessed the number the computer had guessed: \n\n";
cout << "Do you want to quit y/n? ";
cin >> quit;
}
return 0;
}