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.”

1st C++ Program [Printing Hello World]

This is the first basic program in c++ on “How to print Hello World” in c++

We use iostream.h for the basic functions in c++ like we used stdio.h in c.

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

You can download dev c++ from here

 

Program Code:

 

Continue reading “1st C++ Program [Printing Hello World]”