c++ program for muliconstructer - c program with parth patthar

c program with parth patthar

learn c and c++ in better way and with simple example.

Believe on your own logic

Saturday, November 24, 2018

c++ program for muliconstructer

//multi constructer

#include<iostream.h>
#include<conio.h>
class bca
{
int x,y;
public:
bca()
{
x=20;
y=30;
}
bca(bca &a)
{
x=a.x;
y=a.y;
}
bca(int a,int b)
{
x=a;
y=b;
}
void put()
{
cout<<"\n"<<x<<"\t"<<y;
}
};
int main()
{
bca b1,b2(5,10),b3(b2);
clrscr();
b1.put();
b2.put();
b3.put();
getch();
return(0);
}

No comments:

Post a Comment