You are on page 1of 1

EXP4_3 #include<iostream.h> #include<conio.h> #include<string.

h> class staff { public: char name[20],post[20]; void accept() { cout<<"Name: "; cin>>name; cout<<"Post[PEON,FACULTY,HOD]: "; cin>>post; strupr(post); } void display() { if(strcmp(post,"HOD")==0) { cout<<endl<<name; } } }; void main() { int i; clrscr(); staff s[5]; for(i=0;i<5;i++) { cout<<"Details of staff "<<i+1<<"\n"; s[i].accept(); } cout<<"Name of the staff with the post HOD are:"; for(i=0;i<5;i++) { { s[i].display(); } } getch(); }

Page 1

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)