How to display prime numbers using C++ program

In the below program we have defined the checkPrimeNumber() function to check the prime number from the given maximum range of number by the user. This is a very easy program to display prime numbers using C++ programming language.

How to display prime numbers using C++ program

Output is:

Enter maximum range of prime number: 50
Prime numbers is:
2 3 4 5 7 11 13 17 19 23 29 31 37 41 43 47

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,