Hello. I need to make two different if statements according to users input. User have two choices (Y/N). How can I make if statements according to users input.
#include <iostream>
usingnamespace std;
int main ()
{
char answer1;
cout << ", do you want to buy some tomato? (Y/N):";
cin >> answer1;
if ( answer1 != 'Y' && answer1 != 'N')
cout << ", you have entered an incorrect character.";
return 0;
}
Also please don't delete your posts it is VERY ANNOYING since we can't follow the conversation and other people that search this forum for the same answer won't be able to get help from this thread.
I'm almost to the point of reporting users for doing this but I'm resisting because I'm probably overreacting to a pet peeve of mine.