Jumping in C++ Chapter 5 Question 2
Hello again. Thanks for the help on Question 1 in Jumping in C++ but now my program won’t work for question 2. This was my program.
Code:
#include <iostream>
#include <string>
usingnamespacestd;
int main()
{
string program;
while(true)
{
cout<<"Choose a following program:\n";
cout<<"Minecraft.\nSkype.\nSkyrim.\n";
cin>>program;
if(program=="Minecraft"||"Skype"||"Skyrim")
{
cout<<"You chose: "<<program<<".\n";
break;
}
else
{
continue;
}
}
}
But whenever I don’t type in a opinion from the menu it doesn’t reprint the menu, it says "You chose:” and then whatever the user input was.
Can you please tell me why it won;t work and how to fix it?
Thanks.