PROGRAM persegi;
USES crt;
VAR
n,i,j:integer;
BEGIN
clrscr;
writeln('MEMBENTUK BANGUN PERSEGI DENGAN LOOP');
writeln('====================================');
write('Masukkan ukuran persegi : ');readln(n);
writeln;
FOR i:=1 TO n DO
write('* ');
writeln;
FOR j:=1 TO n-2 DO
BEGIN
write('* ');
FOR i:=1 TO n-2 DO
write(' ');
write('*');
writeln;
END;
FOR i:=1 TO n DO
write('* ');
readln;
END.
Tidak ada komentar:
Posting Komentar