#include<conio.h>
#include<stdio.h>
class swaping
{
int a,b,c;
public:
void input();
void process();
void display();
};
void swaping::input()
{
cout<<"Enter the value of A=";
cin>>a;
cout<<"Enter the value of B=";
cin>>b;
}
void swaping::process()
{
c=a;
a=b;
b=c;
}
void swaping::display()
{
cout<<"A="<<a<<"B="<<b;
}
void main()
{
clrscr();
swaping s;
s.input();
s.process();
s.display();
getch();
}
No comments:
Post a Comment