C++ Program to add Two numbers

C++ Program to add Two numbers

How can we add two numbers in C++? We can add numbers using arithmetic operator "+" and print their sum using 'cout'.

Addition of two numbers in C++ :


#include <iostream>
using namespace std;

int main()
{
    int x,y,sum;
    cout << "Please Enter the First Number : ";
    cin >> x;
    cout << "Please Enter the Second Number : ";
    cin >> y;
    sum = x+y;
    cout << "The sum of "<< x << " and is "<< y << " : " << sum;
    return 0;
}


Output :