A bit more concise than mine - I was going to start the y loop at current value of x rather than 1.
Shouldn't it be x <=y ??
Thank you all for your help
the correct is to be the program like this:
#include<iostream.h>
void main()
{
for(int x=1; x<=50;x++)
{
for(int y =x; y<=50;y++)
{
for (int z =y;z<=50;z++)
{
if( x*x+y*y==z*z)
cout<<"x: "<<x<<" y: "<<y<<" z: "<<z<<endl;
}
}
}