C++ program to add two numbers
Learn, how to add two (2) numbers in C++.
Here is an example program, where it takes the input of a first number and second number and returns the sum of it.
#include <iostream>
using namespace std;
int main()
{
int firstNumber, secondNumber, sum;
cout << "Enter two integers to add\n";
// taking input
cin >> firstNumber >> secondNumber;
// adding two numbers
sum = firstNumber + secondNumber;
// displaying sum
cout <<"Sum of the numbers: " << sum << endl;
return 0;
}