Friday 24 January 2020

Simple method to sum of two numbers in CPP

Source Code -
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter two numbers: ";
cin>>a>>b;
c=a+b;
cout<<"The sum of the numbers is: ";
cout<<c;
return 0;
}

Program Output -
Enter two numbers: 9
3
The sum of the numbers is: 12

No comments:

Post a Comment