Using a while loop to check for an error in user input. I was getting an infinite loop without the return statement, how can I end the loop when the condition is met.
//QUESTION
char choice;
cout << "Would you like to give the down payment as a dollar amount($) or percent(%)" << endl;
cout << "Enter either symbol: % or $ " << endl;
cin >> choice;
//ERROR MESSAGE LOOP
while(choice != '$' || choice != '%') {
cout << "ERROR: Try Again, invalid input! Enter either symbol: % or $"<<endl;
cin>>choice;
if( choice == '%' || choice == '$') {
return choice;
}
}