Program Ketupat;
Uses Crt;
Procedure gambarketupat (N : Integer);
Var w,x,y,z : Integer;
Begin
x := N - (N Mod 2);
y := (N div 2) + 1;
For Z := 1 To N do
Begin
For W := 1 To N do
Begin
If ((w = y) or (w = N + 1 - y)) Then
write (w) {bisa di ganti angka/huruf/symbol lain}
else
write (' ');
End;
Writeln;
y := (y mod x)+ 1;
End;
End;
Var
X : Integer;
Ulang : Char;
Begin
Repeat
Clrscr;
Write ('Masukkan Tinggi Ketupat : ');
Readln (X);
Writeln ;
gambarketupat (X);
Writeln;
Write ('Mulai Ulang (y/n) ? ');
Readln (Ulang);
Until Ulang <> 'y';
End.
***** SEMOGA BERMANFAAT *****
Tidak ada komentar:
Posting Komentar