Upload
venantius-denny
View
25
Download
0
Embed Size (px)
Citation preview
Contoh program untuk bilangan prima
uses wincrt;var a,b,c,d,e:longint;begin clrscr;write(‘Input Bilangan Prima Sampai Nilai : ‘); readln(c);writeln(’2′:7);for a:=3 to c dobeginfor b:= 2 to a-1 dobeginif a mod b = 0 then begind:=a ; end else begin e:=a; end;end;if a=d thenbeginb:= a-1;end elsewriteln(e:7);end;end.