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) { int original = *x; *x = original * (original - 1); } 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 297 students.
Sign up free to check your answer
Sign up freeLoading lesson…

