BELAH KETUPAT UNIK

program belah_ketupat;

uses wincrt;

var

baris,kolom,jumbaris:integer;

begin

writeln(‘PROGARM BELAH KETUPAT’);

writeln(‘———————‘);

writeln;

write(‘jumlah baris : ‘);

readln(jumbaris);

writeln;

baris :=1;

while baris <= jumbaris-1 do

begin

write(‘*’: jumbaris+1-baris);

kolom:=2;

while kolom <= (2*baris-1) do

begin

write(‘*’);

kolom :=kolom+1;

end;

writeln;

baris:=baris+1;

end;

baris :=jumbaris;

while baris >= 1 do

begin

write(‘*’:jumbaris+1-baris);

kolom:=2*baris-1;

while kolom >= 2 do

begin

write(‘*’);

kolom :=kolom-1;

end;

writeln;

baris:=baris-1;

end;

end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s

%d blogger menyukai ini: