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

Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

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.