Program Array Segitiga Pascal


program array_pascal;
uses wincrt;
var input,i,j:word; isi:array [0..20,0..21] of word;
begin
writeln('masukkan berapa tingkat segitiga pascal!');
readln(input);
isi[0,1]:=1;
for i:= 1 to input do
begin
for j:= 1 to i+1 do
begin
isi[i,j]:=isi[i-1,j]+isi[i-1,j-1];
write(isi[i,j]);
end;
writeln;
end;
end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar