Hi, im a new to C++ and i am having an issue with if else if commands. I have the code below, and i am attempting to make it so when prompted "Do you want the correct answers?" you can type yes and it will display the answers, or type no to display "have a nice day" and if neither are typed then it says "you did not enter a valid character" and thats the end of the program.
if you have any help please do leave a message, keep in mind im new to C++
Thanks
-Scott
//NOT ENTIRE PROGRAM
//Additional work
cout << "Do you want the correct answers? (Type yes or no)\n";
char x;
cin >> x;
//cin.ignore(50, '\n');
float PIa=3.14159;
float PI2a=3.14285714;
float Ea=2.718281828459;
if (x == yes)
{
system("CLS");
cout << "Have a nice day!\n";
cin.ignore(50, '\n');
}
else if (x == no)
{
cout << "\"PI\" is equal to: " << PIa << endl
<< "\"E\" is equal to: " << Ea << endl
<< "\"22/7\" is equal to: " << PI2a << endl;
}
else
{
cout << "You did not enter a valid character\n";
}
system("PAUSE");
return 0;
}