A program to calculate and display the sum of 2 numbers entered by the user.

 

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
double a,b,sum;

cout<<"Enter value of first number:";
cin>>a;
cout<<"Enter value of second number:";
cin>>b;

sum=a+b;
cout<<"The sum is:"<<sum;

getch();
}

 

 

< Back