You are on page 1of 1

EXP8_2 #include<iostream.h> #include<conio.

h> class student { public: int roll_no; char *course; void accept() { cout<<"\nEnter your roll no"; cin>>roll_no; } student(char *c="Computer Engineering") { course=c; } void display() { cout<<"\nRoll no:\t"<<roll_no; cout<<"\nCourse:\t"<<course; } }; void main() { int i; clrscr(); student s[2]; for(i=0;i<2;i++) { s[i].accept(); } for(i=0;i<2;i++) { s[i].display(); } getch(); }

Page 1

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