Pythagoras

Posted on 11.06.2010

0


program _c2b2a2;
uses crt;
var
    i,j,k,x  : integer;

begin
    clrscr;
    write(‘Input data –>> ‘); readln(x);
    writeln(‘sqr(i) + sqr(j) = sqr(k)’);
    writeln(‘i’:3, ‘j’:9, ‘k’:9);

    for i:=1 to x do
       for j:=i+1 to x do
          for k:=j+1 to x do
             if (sqr(i)+sqr(j)=sqr(k)) then writeln(i:3, j:9, k:9);

readln;
end.

Posted in: Pascal Code