Menu

Custom Search

C++ lab Program

#include
#include
class num
{
int x,y;
public:
void setdata(int a=10,int b=15);
void displaysum();
};
void num::setdata(int a,int b)
{
x=a;
y=b;
}
void num::displaysum()
{
int sum;
sum=x+y;
cout<<"Sum="< }
void main()
{
num n;
n.setdata(10,50);
n.displaysum();
getch();
}

No comments:

Post a Comment