Saturday, 18 August 2012

swap no. with out using function


#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int i,j,n,a,b,c,d;
char p,q,e;
cout<<"enter the 2 nos to be swaped";
cin>>a>>b;
a=a+b;
b=a-b;
a=a-b;
cout<<a;
cout<<b;
getch();
}

No comments:

Post a Comment