Subscribe:

Senin, 09 April 2012

Membuat Bintang berbentuk Segitiga dengan menggunakan program pascal


uses crt;
var i,n:integer;
begin
clrscr;
write('masukan jumlah n =');
readln(n);

for i:=1 to n do write('*');
writeln;
for i:=1 to n do if (i>1) and (i<=n-1) then write('*') else write(' ');
writeln;
for i:=1 to n do if (i>2) and (i<=n-2) then write('*') else write(' ');
writeln;
for i:=1 to n do if (i>3) and (i<=n-3) then write('*') else write(' ');
writeln;
Readln;
end.

0 komentar:

Posting Komentar

Tinggalkan jejak anda...:)