#include<iostream.h>
#include<conio.h>
class college
{
private:
                static char pname[20];
                char hod[20];
                long phone;
                char email[25];
public:
                void read()
                                {
                                cout<<"Enter HOD Name : ";
                                cin>>hod;
                                cout<<"Enter Email ID : ";
                                cin>>email;
                                cout<<"Enter Contact No : ";
                                cin>>phone;
                                }
                void display()
                                {
                                cout<<"The Principal Name : "<<pname<<endl;
                                cout<<"The HOD Name : "<<hod<<endl;
                                cout<<"The Email ID : "<<email<<endl;
                                cout<<"The Contact No : "<<phone<<endl;
                                }
};
char college::pname[20]="Abhinash Sir";
void main()
{
                college sc,ar,ca;
                clrscr();
                sc.read();
                ar.read();
                ca.read();
                cout<<endl;
                sc.display();
                ar.display();
                ca.display();
                getch();
}

147.PNG

Advertisements