yes
yesn't your face
non't not your coding
yes
#include <iostream>
using namespace std;
//a numbers guessing game
int main()
{
string answer = "";
int guess_max = 100;
int guess_min = 1;
while (guess_min != guess_max) {
cout << "Is the number you are thinking of less than "
<< (guess_max + guess_min + 1) / 2 << "?\n";
cin >> answer;
if (answer == "y" || answer == "Y" || answer == "yes" || answer == "Yes")
guess_max = (guess_max + guess_min) / 2;
else if (answer == "n" || answer == "N" || answer == "no" || answer == "No")
guess_min = (guess_max + guess_min + 1) / 2;
else {
cout << "Bad input!\n";
}
}
cout << "The number you are thinking of is " << guess_min << endl;
}
yes
yea but no but yes
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us