1.

Write the output of the following C++ program code:Note: Assume all required header files are already being included in the program.class seminar{char topic[30];int charges;public:seminar(){strcpy(topic,"Registration");charges=5000;}seminar(char t[]){strcpy(topic,t);charges=5000;}seminar(int c){strcpy(topic,"Registration with Discount");charges=5000-c;}void regis(char t[],int c){strcpy(topic,t);charges=charges+c;}void regis(int c=2000){charges=charges+c;}void subject(char t[],int c){strcpy(topic,t);charges=charges+c;}void show(){cout<<topic<<"@"<<charges<<endl;}};void main(){seminar s1,s2(1000),s3("Genetic Mutation"),s4;s1.show();s2.show();s1.subject("ICT",2000);s1.show();s2.regis("Cyber Crime",2500);s2.show();s3.regis();s3.show();s4=s2;s4.show();getch();}

Answer»

[email protected]

Registration with [email protected]

[email protected]

Cyber [email protected]

Genetic [email protected]

Cyber [email protected]



Discussion

No Comment Found

Related InterviewSolutions