Pascal : Coding Bintang Piramid
December 21, 2019 No Comments Ari Usman,Artikel Komputer,Pascal Ari Usman

Program Bintang1;
uses crt;
var i,j,n:integer;
begin
clrscr;
writeln(‘———————————————–‘);
writeln(‘ PROGRAM BINTANG BERBENTUK PIRAMID ‘);
writeln(‘———————————————–‘);
write(‘masukkan nilai = ‘); readln (n);
for i:=1 to n do
begin
if (i mod 2 = 1) then
begin
for j:=1 to ((n-i) div 2) do write(‘ ‘);
for j:=1 to i do write(‘*’);
writeln;
end;
end;
readln;
readkey;
end.

Visited 4 times, 1 visit(s) today
Tags
About The Author
Ari Usman Seorang Praktisi IT di Bidang Digital Marketing dan Dosen di Bidang Teknik Informatika

Leave a reply

Your email address will not be published. Required fields are marked *