MCQOPTIONS
Saved Bookmarks
| 1. |
Which is the implementation of the swap function?1.void swap (int a, int b) { int temp; temp = a; a = b; b = temp; } int main () { int i = 0, j = 1; swap (i, j); } 2.void swap (int&a, int&b) { int temp; temp = a; a = b; b = temp; } int main () { int i = 0, j = 1; swap (i, j); } 3.void swap (int *a, int *b) { int *temp; temp = a; a = b; b = temp; } int main () { int i = 0, j = 1; swap (&i, &j); } |
| A. | 3 Only |
| B. | 2 Only |
| C. | 2 and 3 only |
| D. | None of the above. |
| Answer» C. 2 and 3 only | |