Program bil_prima;
uses crt;
var
a,b,c,d : integer;
BEGIN clrscr;
write('Masukan Bilangan Prima sampai : '); readln(d);
for a:= 1 to d do
Begin;
c:=0;
for b:=1 to a do
Begin;
if a mod b=0 then
c:=c+1;
end;
if c=2 then
begin;
write(a,' ');
write('');
end;
end;
readln;
END.
END.
Selasa, 02 Mei 2017
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar