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

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: , , , , ,

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.

Solved Programs