Friday, September 2, 2016

Tags

PROGRAM TO SWAP TWO NUMBERS WITHOUT USING THIRD VARIABLE:
#include<iostream>
using namespace std;
main()
{
int a,b;
cout<<"ENTER THE VALUE OF A";
cin>>a;
cout<<"\nENTER THE VALUE OF B";
cin>>b;
a=a+b;b=a-b;
a=a-b;
cout<<"\nAFTER SWAPPING";
cout<<"\nA="<<a<<"\nB="<<b;
}