Minggu, 03 Juni 2012
bahasa pemograman pascal bilangan random - matrik
program Bilangan_Random ;
uses crt ;
var
list : array [1..100] of integer;
i,n : integer;
ch : char ;
Begin
repeat
clrscr;
write('Banyaknya bilangan acak (maksimum 100) = ');
repeat
gotoxy(40,1);
clreol;
readln(n);
until (n>0) and (n<=100);
randomize;
for i := 1 to n do
begin
list [i] := random(1000);
write(list [i] : 5);
if (i mod 12 = 0) then writeln;
end;
gotoxy(20,24);
writeln('Mau ulang lagi? [Y/N] ');
repeat
ch := readkey;
until upcase(ch) in['Y', 'N'] ;
until upcase(ch) = 'N';
end.
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar