Menu

Custom Search

C++ lab Program

#include
#include
class product
{
private:
int a,b,c;
public:
product()
{
a=0;b=0;
cout<<"default constructer"<
}
product(int x,int y=5)
{
a=x;
b=y;
cout<<"parameterised constructer"<
}
void display()
{
c=a*b;
cout<<"product="< }
};
void main()
{
clrscr();
product p1;
p1.display();
product p2(10);
p2.display();
getch();
}

No comments:

Post a Comment