Tuesday, 28 October 2014

Accept two number from the user and display their sum



Accept two number from the user and display their sum



/*WAP to accept two number from the user and display their sum*/

#include<iostream.h>
#include<conio.h>
void main()
{
      clrscr();
      int a,b,s;
      cout<<"Enter two numbers:";
      cin>>a>>b;
      s=a+b;
      cout<<"Sum is "<<s;
      getch();
}

OUTPUT:
Enter two numbers:45 55

Sum is 100

No comments:

Post a Comment