LOVEGUN

Function Premier (rework)

Jan 9th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.15 KB | None | 0 0
  1. Function premier (x:longint): Boolean;
  2. Var i,nb: longint;
  3. Begin
  4.     nb:=0;
  5.     for i:=1 to x  Do
  6.         if  x mod i = 0 Then nb:=nb+1;
  7.     premier:=nb=2;
  8. End;
Advertisement
Add Comment
Please, Sign In to add comment