

MCQOPTIONS
Saved Bookmarks
1. |
What will be the output of the following program? #include<iostream.h> class IndiaBix { public: int x, y; IndiaBix(int xx = 10, int yy = 20) { x = xx; y = yy; } void Exchange(int *, int *); }; int main() { IndiaBix objA(30, 40); IndiaBix objB(50); objA.Exchange(&objA.x, &objB.y); cout<< objA.x << " " << objB.y << endl; return 0; } void IndiaBix::Exchange(int *x, int *y) { int t; t = *x; *x = *y; *y = t ; } |
A. | 20 10 |
B. | 30 20 |
C. | 20 30 |
D. | 30 40 |
E. | 50 30 |
Answer» D. 30 40 | |