Program to display the number of prime numbers in the range entered by user and to display their sum.

This program will take a number as input from user and will display the number of prime numbers in the range starting from 0 to the number entered by user.

Also, it will be the sum of the prime numbers in that range.

We will be displaying program which is compatible with Dev C++.

You can download dev c++ from here

 

Program Code:

 

Continue reading “Program to display the number of prime numbers in the range entered by user and to display their sum.”

Program to find whether the number entered by user is prime or not.

This program checks whether a number is prime or not by dividing the entered number by all the numbers starting from 2 to the( entered number -1) and if the remainder is found to be 0 for any number then it will be displayed that the entered number is not a prime number.

But if none of the numbers have remainder as 0 then it will be displayed that the entered number is a prime number.

 

We will be displaying program which is compatible with Dev C++.

You can download dev c++ from here

 

Program Code:

 

Continue reading “Program to find whether the number entered by user is prime or not.”