class PrimeNo{ public static void main(String args[]){ int num = Integer.parseInt(args[0]); int flag=0; for(int i=2;i<num;i++){ if(num%i==0) { System.out.println(num+" is not a Prime Number"); flag = 1; break; } } if(flag==0) System.out.println(num+" is a Prime Number"); } }
JAVA LEARNING:An art and entertainment for those who love it. For Online Assistance and help @email:Learnprogramm@gmail.com
Thursday, 28 April 2011
PROGRAM TO FIND WHETHER A NUMBER IS PRIME OR NOT...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment