Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public class Prime {
  2. public static void main(String[] args)
  3. {
  4. int i;
  5. int stevilo=20;
  6. boolean pra=true;
  7.  
  8. for(i=2;i<(int)Math.sqrt(stevilo);i++)
  9. {
  10. if(stevilo%i==0) {
  11. pra=false;
  12. break;
  13. }
  14. }
  15.  
  16. if (pra==true)
  17. System.out.print("stevilo je prastevilo");
  18. else
  19. System.out.print("Stevilo ni prastevilo");
  20. }
  21. }
Add Comment
Please, Sign In to add comment