Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. print primeCheck(13)
  2.  
  3. end
  4.  
  5. function primeCheck(x)
  6. for num = x to 0 step -1
  7. if x/num = int(x/num) and num > 1 then
  8. primeCheck = 0
  9. exit for
  10. end if
  11. if x/num = 1 and x <> num then
  12. primeCheck = 1
  13. exit for
  14. end if
  15. next num
  16.  
  17. end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement