0

my question is how can i make my program not to display any unique combination more that ones?

//*****f04.cpp*****
//Name:
//Date: 02 - 17 - 08


#include <iostream>
using namespace std;


int main ()
{
// #1
int a, b, c;
for (c = 1; c *c <= 100; c++)
{
for (a = 1; a <= 100; a++)
{
for (b = 1; b <= 100; b++)
{
if (c * c == a * a + b * b)
cout << c << ", " << a << " and " << b << endl;
}
}


}

Edited by happygeek: fixed formatting

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Dr_Pepper
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.