C++ Program to Add Two Numbers

 C++ Program to Add 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. 



source code : 
//wap to add two numbers 
#include<iostream>
using namespace std;
int main(){
    int a,b,sum;
    cout<<"Enter the first number : "<<endl;
    cin>>a;
    cout<<"Enter the second number : "<<endl;
    cin>>b;
    sum=a+b;
    cout<<"The sum of numbers is : "<<sum<<endl;
    return 0;
}

Previous
Next Post »