EWTD

prime numbers till n

Sep 16th, 2017
134
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program lolkek;
  2.  
  3. var
  4.   a, i, b: integer;
  5.   ans:boolean;
  6.  
  7. function pr(a: integer): boolean;
  8. var
  9.   i: integer;
  10.   ans: boolean;
  11. begin
  12.   ans := False;
  13.   for i := 2 to (a - 1) do
  14.   begin
  15.     if (a mod i) = 0 then
  16.       ans := True;
  17.   end;
  18.   result := ans;
  19. end;
  20.  
  21. begin
  22.   for i:= 1 to 500 do
  23.   begin
  24.   if not(pr(i,b,ans)) then
  25.   writeln(i);
  26.   end;
  27. end.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×