PROGRAM BINTANG BERBENTUK PIRAMID (PASCAL)

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.

0 komentar:

 

Usage Rights

DesignBlog BloggerTheme comes under a Creative Commons License.This template is free of charge to create a personal blog.You can make changes to the templates to suit your needs.But You must keep the footer links Intact.