Program mencetak huruf N



program cetak_n;
uses wincrt;
var
   i,j,n:integer;

begin
writeln('------------------------------');
writeln('   Program mencetak huruf N   ');
writeln('------------------------------');
writeln;

write('Masukkan angka : ');readln(n);
writeln;
writeln('Hasilnya : ');
writeln;
for j:=1 to n do
    begin
           
        for i:=1 to n do
            begin
                 if (i=1) or (j=i) or (i=n) then
                write('*')
                else
                write(' ');
            end;
        writeln;

    end;
end.

screenshot output program

Semoga Bermanfaat.....


Comments
0 Comments