What will be the output of the following C++ code? #include <iostream> using…
What will be the output of the following C++ code? #include <iostream> using namespace std; void square (int *x, int *y) { *x = (*x) * --(*y); } int main() { int number = 30; square(&number, &number); cout << number; return 0; }
- A.
30
- B.
870
- C.
Segmentation fault
- D.
More than one of the above
- E.
None of the above
Attempted by 540 students.
Sign up free to check your answer
Sign up freeLoading lesson…

