C++

Add Two Numbers in C++1 min read

Write a C++ program to calculate the sum of two numbers.

In this program, user is asked to enter two integers. These two integers are stored in variables firstNumber and secondNumber respectively.

Then, the variables firstNumber and secondNumber are added using + operator and stored in sumOfTwoNumbers variable.

Finally, sumOfTwoNumbers is displayed on the screen.




C++ Code:

Output:

Leave a Comment