Well, the code as it stands has just one cin statement, which allows just a single value to be entered.
It seems you should add another cin >> row inside the body of the loop. That would allow more than one value to be entered, and also would make it possible (by typing 0) to exit from the loop.
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
Chervil has made two good points.
Using what you have you might try this:
1 2 3 4 5 6 7 8 9 10 11 12 13
while (row !=0)
{
if (row <= 10)
{
a++;
//if (a == 5) break;
if (a == 5)
{
b = 5;
c = 5;
break;
}
}
You may need to rethink the if statements because depending on the number entered only one if statement can be used for the number entered. I.E., if row = 2 only the first if statement is used. If row = 13 only the second if statement is used.
This may give "a", "b" and "c" = to 5, but I do not think that is what you want.
Hope that helps,
Andy
P.S. what I think should be line 5 int ,row,a=0,b=0,c=0; you have an extra comma at the beginning.