Quiz 3 - A - Solution

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Object Oriented Programming (CS-217) Spring 2021 Quiz # 3 Roll-No: ------------------------ Section: ------

Write the output of code segments given below and if there is any error, mention clearly.
class Number{ class Question{
public: public:
int* value; Number marks;
Number(int v) { Question(int A) : marks(A) {
value = new int(v); cout << "New Object \n";
cout << "Value: " << *value << endl; }
} Question(const Question &X) :
~Number() { marks(*X.marks.value + 10){
cout << "Killed: " << *value << cout << "ItsEasy" << endl;
endl; }
delete value; };
} void main(){
}; Question Answer(1);
Difficult(Answer);
void Difficult(Question why){ }
Question Quest = why;
}

Output/Error:

You might also like