Tuesday, June 12, 2012

Pascal Bilangan Kuadrat dan Kubik

uses crt;
var a,i,j,k,z : integer;
begin
     clrscr;
     Writeln('         Program Kuadrat dan Kubik ');
     writeln('        -------RIZKA FAJRIAH-------');writeln;
     write ('Masukan angka : ');readln(a);

     writeln;
           write('Bilangan Kuadrat :');WRITELN;
           for i := 1 to a do
           begin
           j := i * i ;
           write(j,' ');
           end;
           writeln; writeln;
           write('Bilangan Kubik: ');WRITELN;
           for z:= 1 to a do
                begin
                k := z*z*z;
                write(k,' ');
                read;
                end;
readkey;
end.

Output:


0 comments:

Post a Comment

Template by:

Free Blog Templates