Question: 9. What is the output of this code? Explain your answer. 1. #include 2. using namespace std; 4. class A 6. public: int val; A()

9. What is the output of this code? Explain your answer. 1. #include 2. using namespace std; 4. class A 6. public: int val; A() { this-> val = 5; void setValue (int a) this int getValue ( return val val - a; ) 10. 12. class B f 13. 14. 15. public: 16. A ob; void foo (A ob) f this -> ob- ob; ob.setValue (10); 18. 19. 20. 1; 21. 22. int main) ( 23. 24. 25 26. 27. 28. 29. 30. 31. 32. 33. A ao; //Line-1 B bo; cout
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
To understand the output of the code lets go through it step by step Class A It has ... View full answer
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
