C++ Program for Addition and Multiplication of Two Numbers

In this program, the user is asked to enter two integer numbers. Then the addition and multiplication is calculated and displayed on console.



Source Code
#include<iostream>
using namespace std;

int main()
{
    int n1, n2, add, mul;
    cout<<"Enter the two numbers: ";
    cin>>n1>>n2;

    add = n1 + n2;
    mul = n1 * n2;

    cout<<"a + b = " << add;
    cout<<"\na * b = " << mul;
    return 0;
}
Output
Enter the two numbers: 5 8
a + b = 13
a * b = 40