C++ Program to Add Two Numbers

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

Output:

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

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