Prime Number - Java Programme to find if the Number is Prime or not.



If number is divisible from 2 to one less than that number, then the number is not prime number otherwise it will be a prime number.

Programme :

Output 1:
Enter a Number : 19
This is a Prime Number

Output 2:
Enter a Number : 20
This is not a Prime Number



Follow me on:

Comments