I need to write the while loop to terminate with a '|' character
program does not terminate correctly when using two cin numbers in the same line or even on separate lines (i.e. cin>>num1>>num2;)
when the program does terminate with ^Z it just scrolls a long list of the last numbers entered.
I've tried the following:
while (num1!='|') //fails
while (num1!=-1) //fails if two inputs from the cin. Works if only one
//cin variable exists. Sentinel value is "-1"
while (num1!=-1 ||num2!=-1) //fails
while (num1!='|' || num2!='|') //fails
The program should terminate if I were to enter "1 2|" or any other terminating character.
Thanks for any help you guys can give