#include <iostream.h> #include <conio.h> #include <string.h> const int size = 10; class country { protected : char name[size]; int nostate; public: country(); void input() { cout<<"Enter Name of Country: "; cin>>name; cout<<"Total Number of States : "; cin>>nostate; } void disp() { cout<<"Name of the Country : "<<name<<"\n"; cout<<"Total number of states : "<<nostate<<"\n"; } }; country::country () { strcpy(name," "); nostate = 0; cout<<" Display the Values Initialised by the Constructors Country()\n"; cout<<"Name "<<name<<" NoState "<<nostate<<"\n"; } class state: public country { protected : char name[size]; double novill; public: state(); void input() { country:: input(); cout<<"Enter Name of State : "; cin>>name; cout<<"Total Number of Villages : "; cin>>novill; } void disp() { country:: disp(); cout<<"State : "<<name<<"\n"; cout<<"Total Villages : "<<novill<<"\n"; } }; state:: state() { strcpy(name," "); novill=0; cout<<"Display the Values Initialised by the Constructors State\n"; cout<<"Name "<<name<<"NoVill "<<novill<<"\n"; } void main( ) { clrscr(); state sl; sl.input(); sl.disp(); getch(); }