Friday 27 July 2012

How to add two number in c++ with two variables only

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 void main()
{
  int a,b;
 cout<<"Enter 1st number.\n";
 cin>>a;
 cout<<"\nEnter Second number\n";
 cin>>b;
 a=a+b;
 cout<<"\nThe sum of two number is \t";
 cout<<a;
 getch();
}

No comments:

Post a Comment

This Blog is not managed by anyone, If you are interested then Contact me avinashkgec@gmail.com

Related Post