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; }

  1. A.

    30

  2. B.

    870

  3. C.

    Segmentation fault

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 540 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…