Thursday, 25 October 2012

Program Of Swap Two Numbers With Class


#include<iostream.h>
#include<conio.h>

{

private:
int a,b;

public:

{

a=x;
b=y;

}
void display()

{
int c;

c=a;
a=b;


cout<<"\n first mumber="<<a;
cout<<"\n second number="<<b;

}
};

main()
{
clrscr();

int p,q;
cout<<" enter first mumber=";

cin>>p;
cout<<"enter second mumber=";

cin>>q;

s1.display();
getch();

}

No comments:

Post a Comment