Tuesday, August 23, 2016

Swapping Two Numbers in C++

#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"Enter two numbers ";
cin>>a>>b;
a=a+b;b=a-b;a=a-b;
cout<<"After Swapping numbers are ";
cout<<a<<""<<b;
return 0;
}

 
 
Do Comment,Share :)
Sharing is Caring ;)

No comments:

Post a Comment