While Loop not workig?!?!
Hi I have the following loop:
and when I input -1 for "s", the program wont exit the loop right away, it continues with asking the user for variable "p" and "m"!! How do I fix that!
Thank you for your time!
while( (cin>>s) && (s!=-1) && (cin>>p>>m) )
a[s-1][p-1] = m;
are you asking the user for 's' outside of the loop, because it looks like you are having the user input the value for 's' inside the loop.
Topic archived. No new replies allowed.