I'm trying to figure out how to avoid printing out permutation of a Pythagorean triplet. Like I have the program all written but I am getting permutations of pythag triple.

Quote

This is what I have:

#include <stdio.h> main () { int side1; int side2; int side3; for (side1 = 1; side1 <= 50; side1++){ for (side2 = 1; side2 <= 50; side2++){ for (side3 = 1; side3 <= 50; side3++){ if ((side1 * side1) + (side2 * side2) == (side3 * side3)){ printf("%d, %d, %d\n", side1, side2, side3); } } } } return 0; }

Any help will be much appreciated, thanks.