cout<<"Enter a number betweeen 1 and 15\n";
cout<<"Is your Number"<<a<<"? y"<<endl;
cout<<"Is your Number"<<a<<"? h"<<endl;
cout<<"Is your nuumber"<<a<<"? l"<<endl;
cout<<"That Took me "<<c<<" times"<<endl;
this a simple program that uses the function rand() the users enter a number between 1 and 15 and the computer tries to find this number the problem is ig i entered the value of x > 15 the program enters an infinte loop so is there a way to stop this
Change the argument within the while loop to while(x <= 15) But you probably want to add another if statement in there so that it won't print out cout<<"That Took me "<<c<<" times"<<endl; Even if the number is above 15.