Posted by : Erick Elfrada Sinurat Selasa, 19 Juni 2012

Program Segitiga pascal
uses wincrt;
type pas=array[1..20,1..20] of longint;
var pascal:pas;
i,j,n:integer;
begin
pascal[1,1]:=1;

write('banyak level : ');readln(n);{:=10;}
for i:=2 to n do
begin
pascal[i,1]:=1;
pascal[i,i]:=1;
for j:=2 to i-1 do
pascal[i,j]:=pascal[i-1,j-1]+pascal[i-1,j];
end;
16
{write(pascal[2,1],' ');
writeln;}
for i:=1 to n do
begin
for j:=1 to i do
write(pascal[i,j],' ');
writeln;
end;
end.

Hasilnya adalah:

Leave a Reply

Subscribe to Posts | Subscribe to Comments

^^Find Me^^

^^Translate^^

^^God Enel^^

^^God Enel^^
My Favorite Anime Character

- Copyright © Elfrada.com - You'll Get it Here-|-Robotic Notes-|-Powered by Blogger -|- Designed by Erick Elfrada -