Hi
as you can tell from this I am new to programming. This is an excerpt from a calculator I am trying to make. This is so that the program doesn't break when you enter something other than 1 through 4, but it breaks if I input a letter. What can I do to the program so entering a letter won't hurt it? Sorry about the long-winded explanation.
int answer;
cout<<"Would you like to multiply(1), divide(2), add(3), or subtract(4)?"<<endl;
cin>>answer;
while (answer!=1-4)
{
cout<<"Sorry, I didn't quite get that, could you please repeat that?" <<endl;
cin>>answer;
if (answer!=1-4)
{
continue;
}
else if (answer==1-4)
{
break;
}
else if (answer== Here Is The Problem )
{
continue;
}
}