Write a C++ program to swap the values of a pair of integers using reference variables
#include #include class abc { private: int t; public: void swap(int *a, int *b) { t=*a; *a=*b; *b=t; } }; void main() { int a,b; clrscr(); abc sa; cout<<"Enter the values of A: "; cin>>a; cout<<"Enter the values of B: "; cin>>b; sa.swap(&a,&b); cout<<"\nValues of A is: "< OUTPUT
Enter the values of A:32 Enter the values of B:65 Values of A is: 65 Values of B is: 32