C++ Program to Add Two Numbers

C++ Adding Two Numbers

In this program, user is asked to enter two integers. Then, the sum of those two integers is stored in a variable and displayed on the screen. Primary tabs.
#include <iostream.h>
#include <conio.h>
int main()
{
    int No1, No2, Ans;
    cout << "Enter two integers: ";
    cin >> No1 >> No2;
    Ans = No1 + No2;
    cout << No1 << " + " <<  No2 << " = " << Ans;
    getch();
}
Enter two integers: 4   5
4 + 5 = 9

Hits: 0

Leave a Reply

Your email address will not be published. Required fields are marked *