Trouble with loop

In my Computer Science 1 class we have an assignment were we ask the user the maximum value that one side of a right triangle can have. Then find all of the pythagorean triples in that range. The program is supposed to allow the user to repeat until they enter 0. The program works once and then when you put in a new max value it ends the program. I'm not sure what is wrong with my code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
using namespace std;
int main ()

{
	int count = 0;
	int N, a, b, c;
	do
	{
		cout << "Please enter the maximum value for one side of the triangle. If you wish to stop enter 0. \n";
		cin >> N;
		for (int a = 1; a <= N; a++)
		{
			for (int b = a; b <= N; b++)
			{
				for (c = b; c <= N; c++) 
				{ 
					if ( (c*c) == (a*a)+(b*b) )
					{	
						cout << "a = " << a << " " << "b = " << b << " " << "c = " << c << endl;
						count++;
						
					}
				}	
			}
		}
		cout << "Total number of pythagorean triples: " << count << endl; 
		cout << "Enter a new maximum value or press 0 to stop. \n";
		cin >> N;
	}
	while (N == 0);
	system ("pause");
	return 0;
}

Any help would be greatly appreciated.
Ummm I may be mistaken, But I think that you have this program going so that it ONLY repeats if 0 is entered. Try changing the While statement to (N != 0) instead of (N == 0) and see if that helps.
Yes. That was my problem. Thanks so much!
Topic archived. No new replies allowed.