Program to display sum of two numbers in C++
Program of sum of two numbers in C++
It is a simple addition program which gives addition of two numbers
Program :-
#include<iostream.h>
void main ()
{
int a,b,sum;
cout<<"Enter the value of first no :-";
cin>>a;
cout<<"Enter the value of second no :-";
cin>>b;
sum=a+b;
cout<<"The value of two numbers"<<sum<<;
}
Output :-
Enter the value of first no :- 2
Enter the value of second no :- 3
The value of two numbers :- 5
It is a simple addition program which gives addition of two numbers
Program :-
#include<iostream.h>
void main ()
{
int a,b,sum;
cout<<"Enter the value of first no :-";
cin>>a;
cout<<"Enter the value of second no :-";
cin>>b;
sum=a+b;
cout<<"The value of two numbers"<<sum<<;
}
Output :-
Enter the value of first no :- 2
Enter the value of second no :- 3
The value of two numbers :- 5
Comments
Post a Comment