uses wincrt;
var a,b,c,d,e:longint;
begin
write('Input Bilangan Prima Sampai Nilai : '); readln(c);
writeln('2':7);
for a:=3 to c do
begin
for b:= 2 to a-1 do
begin
if a mod b = 0 then begin
d:=a ; end else begin e:=a; end; end;
if a=d then
begin
b:= a-1;
end else
writeln(e:7);
end;
readln;
end.
0 comments:
Post a Comment