Ini source codenya :
uses wincrt;
var
i,n,j : integer;
lagi : char;
begin
lagi:='y';
repeat
clrscr;
writeln('------------------------------');
writeln(' program mencetak huruf C ');
writeln('------------------------------');
writeln;
write('Masukkan angka : ');readln(n);
writeln;
writeln('Hasilnya : ');
writeln;
for i:= 1 to n do
begin
for j:=1 to n do
begin
if (i=1) or (j=1) or (i=n) then
write('*')
else
write('');
end;
writeln;
end;
writeln;
write('Ulangi ? (y/t):');readln(lagi);
until (lagi='t')or(lagi='T');
donewincrt;
end.
Running program :
uses wincrt;
var
i,n,j : integer;
lagi : char;
begin
lagi:='y';
repeat
clrscr;
writeln('------------------------------');
writeln(' program mencetak huruf C ');
writeln('------------------------------');
writeln;
write('Masukkan angka : ');readln(n);
writeln;
writeln('Hasilnya : ');
writeln;
for i:= 1 to n do
begin
for j:=1 to n do
begin
if (i=1) or (j=1) or (i=n) then
write('*')
else
write('');
end;
writeln;
end;
writeln;
write('Ulangi ? (y/t):');readln(lagi);
until (lagi='t')or(lagi='T');
donewincrt;
end.
Running program :
0 comments:
Posting Komentar