Program to implement the concept of constructor.

#include
#include
class bca
{
private:
int x;
public:
void getdata()
{
cout<>x;
}
void display()
{
cout<<"n Entered value of x was:"<<x;
}
bca();
}
bca::bca()
{
cout<<"n Date of Birth:";
}
main()

{
bca a,b,c,d,e,f,g,h;
getch();
}

Leave a reply