Free Classified Site - Bedpage

Prime Number Program in Java

Prem Tiwari - - Java Programming


Prime Number Program in Java | prime number program in java using for loop

Prime Number Program in Java: This is a simple Java program to find the prime number. A prime number is a number which is greater than 1 and only divisible by 1 or itself.

In the below example, we have shared the first 10 prime number which you can test using below Java program to confirm the Prime number program in Java programming language.

Prime Number Program in Java

In this program, I have taken number as variable to hold the number which will be checked whether it is a prime number or not.

Copy the below java program and execute it with the help of Java compiler to print the prime number program in java with the output for your better under standing the concept of prime number.

Output of Prime Number Program in Java

11 is prime number


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


Tags: , , , , , , , , ,

Recommended Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.