PROGRAM TO IMPLEMENT CONSTRUCTOR OVERLOADING

/*PROGRAM TO IMPLEMENT CONSTRUCTOR OVERLOADING*/ #include<iostream.h> #include<conio.h> class rectangle { int length,breadth; public: rectangle() { length=breadth=0; cout<<“**Constructor with zero argument called**”<<endl<<endl; } rectangle(int a) { length=breadth=a; cout<<“**Constructor with one argument …

PROGRAM TO IMPLEMENT COPY CONSTRUCTOR

/*PROGRAM TO IMPLEMENT COPY CONSTRUCTOR*/ #include<conio.h> #include<iostream.h> class abc { int a,b,sum; public: abc() { cout<<“Enter a: “; cin>>a; cout<<“Enter b: “; cin>>b; } abc(abc &m) { a=m.a; b=m.b; cout<<“a= …

PROGRAM TO IMPLEMENT PARAMETERIZED CONSTRUCTOR

/*PROGRAM TO IMPLEMENT PARAMETERIZED CONSTRUCTOR*/ #include<iostream.h> #include<conio.h> class area { int length,breadth; public: area(int l,int b) { length=l; breadth=b; cout<<“Length of rectangle is:”<<length<<endl; cout<<“Breadth of rectangle is: “<<breadth<<endl; } void …

PROGRAM TO IMPLEMENT DEFAULT CONSTRUTOR

/*PROGRAM TO IMPLEMENT DEFAULT CONSTRUTOR*/ #include<conio.h> #include<iostream.h> class area { int l,b; public: area() { cout<<“Enter length of rectangle: “; cin>>l; cout<<“Enter breadth of rectangle: “; cin>>b; } void display() …

PROGRAM TO SHOW CONCEPT OF FRIEND CLASS

/*PROGRAM TO SHOW CONCEPT OF FRIEND CLASS*/ #include<conio.h> #include<iostream.h> class tempA { int a; public: void get_a() { cout<<“Enter a: “; cin>>a; } friend class tempB; }; class tempB { …