#include<iostream.h>
#include<conio.h>
int swap(int *x,int *y);
main()
{
int a,b;
clrscr();
cout<<"enter the first no=";
cin>>a;
cout<<"enter the second no=";
cin>>b;
swap(&a,&b);
cout<<"\nswaping of a="<<a;
cout<<"\nswaping of b="<<b;
getch();
}
int swap(int *x,int *y)
{
int z;
z=*x;
*x=*y;
*y=z;
cout<<"swaping of x="<<*x;
cout<<"\nswaping of y="<<*y;
getch( );
}
No comments:
Post a Comment