You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
class swap //class defined
{
int a,b,c;
public:
void swapping()
{
cout<<"enter the numbers "<<"\n";
cout<<"a= ";
cin>>a;
cout<<"b= ";
cin>>b;
c=a;
a=b;
b=c;
cout<<"Result is : "<<"\n a="<<a<<"\n b="<<b;
}
};
void main()
{
clrscr();
swap obj; //obj is class_item
obj.swapping(); //swapping functiin being called
getch();
}

You might also like