facebook rss daftar isi halaman depan

Laman

Sabtu, 30 Oktober 2010

segitiga pascal

program bintang_piramid;
uses wincrt;

var c,a,b,n : integer;
begin
write ('masukkan angka : ');readln(n);
writeln;
if n mod 2 = 0 then
for a := 1 to (n div 2) do begin
for b := 1 to (n div 2)-a do
write (' ');
for c := 1 to (a*2) do
write ('*');
writeln;
end
else
for a := 1 to (n div 2)+1 do begin
for b := 1 to (n div 2)+(1-a) do
write (' ');
for c := 1 to (a*2)-1 do
write ('*');
writeln;
end;
end.

Tidak ada komentar:

Posting Komentar

terimakasih aras kunjungan anda di blog mesujiraya
komentarnya saya tunggu mas bro & mbak sist