- Get link
- X
- Other Apps
POST -
All the code given below is compiled using turbo CPP and working totally fine but if you are using any new IDE there might be some difference in code...
#include<iostream.h>
#include<conio.h>
void swap (int &x , int &y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int a, b;
clrscr();
cout<<"Enter The Value Of A : ";
cin>>a;
cout<<"Enter The Value Of B : ";
cin>>b;
swap(a,b);
cout<<"After Swapping..."<<endl;
cout<<"A= "<<a<<endl;
cout<<"B= "<<b<<endl;
getch();
return(0);
}
OUTPUT:
Excellent
ReplyDelete