C++ Program to Add Two Numbers

Prem Tiwari - - C++ Tutorial

This is a simple & easy C++ program to add two number entered by the user while executing this program. I assume you have basic knowledge of C++. In the below program, there are three variable x, y, and sum. x and y hold the value of entered by the user and then add the both number using add operator (+) and store into sum variable.

Finally, print the sum to see the program output. The output will be the addition of x and y:

sum = x + y

C++ Program to Add Two Numbers


Enter two integers for addition: 5
5 + 10 = 15

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