CODE:
#include<iostream.h>
#include<conio.h>
void swap(int*,int*);
void main()
{
clrscr();
int a,b;
cout<<”Enter two numbers : “;
cin>>a>>b;
swap(&a,&b);
cout<<”Swapped numbers are(call by address) : ”;
cout<<a<<” “<<b;
getch();
}
void swap(int *a,int *b)
{int z;
z=*a;
*a=*b;
*b=z;
}
For Further Reading,
0 comments:
Post a Comment