I am creating a small program that uses the if else statement, but instead of using numbers to control the flow, I want the control to work with yes and no,
eg:
cout << "would you like to continue?" << endl;
cout << "\nYES or NO" << endl;
int input =0;
cin >> input;
string Yes = "YES";
string No = "NO";
if (input == no)
{
cout << "testone" << endl;
}
if (input == yes)
{
cout << "test two" << endl;
}
else
{
cout << "you entered the wrong thing, start again" << endl;
}
but I don't seem to be able to use any variations of this, I can get the user to enter 0 or 1 instead, but it seems really dumb, I would prefer it to be as natural as possible, users don’t tell if they ?
also i just need to add more words, for example "no NO No noo no n", all of this would mean no
hope that makes sense
, ++ , - Windows.