SHARE
TWEET

Untitled

a guest Dec 5th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PrimeNum
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         int i, j;
  6.         boolean isprime;
  7.        
  8.         for (i = 2; i <= 100; i++)
  9.         {
  10.             isprime = true;
  11.            
  12.             for(j=2; j <= i/j; j++)
  13.             {
  14.                 if((i%j) == 0) isprime = false;
  15.             }
  16.            
  17.             if(isprime)
  18.             {
  19.                 System.out.println(i + " is prime");
  20.             }
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top