#include <iostream>
using namespace std;
void swap(int *,int *,int *);
int main()
{
int a ,b ,c;
cout <<“enter a: “;
cin >> a;
cout <<“\nenter b: “;
cin >> b;
cout <<“\nenter c: “;
cin >> c;
cout <<“before swaping a b c”<< endl;
cout <<“a b c “<<a<<” “<<b<<” “<<c<<endl;
swap(&a,&b,&c);
cout <<“after swaping a b c”<< endl;
cout <<“a b c “<<a<<” “<<b<<” “<<c<<endl;
return 0;
}
void swap(int *ptr1,int *ptr2,int *ptr3)
{
int temp;
temp=*ptr1;
*ptr1=*ptr2;
*ptr2=*ptr3;
*ptr3=temp;
}