MCQOPTIONS
Saved Bookmarks
| 1. |
What will be the output of the following program? #include<iostream.h> class BixBase { public: int x, y; BixBase(int xx = 0, int yy = 5) { x = ++xx; y = --yy; } void Display() { cout<< --y; } ~BixBase(){} }; class BixDerived : public BixBase { public: void Increment() { y++; } void Display() { cout<< --y; } }; int main() { BixDerived objBix; objBix.Increment(); objBix.Display(); return 0; } |
| A. | 3 |
| B. | 4 |
| C. | 5 |
| D. | Garbage-value |
| E. | The program will report compile time error. |
| Answer» C. 5 | |