C++ code to find sum of two numbers given by user

Source Code


#include<iostream>
using namespace std;
int main()
{
int n1,n2,sum;
cout<<"Enter any Two numbers \n"; //Ask the user for number
cin>>n1>>n2; //read the number entered by user
sum=n1+n2;
cout<<"The sum is "< return 0;
}


OUTPUT


Enter any Two numbers
5
10
The sum is 15

Post a Comment

0 Comments