What is the output of this C++ program? #include <iostream> using namespace…
ISRO Scientist/Engineer SC 2017Modified — slightly modified from the official paper; see the solution
What is the output of this C++ program?
#include <iostream>
using namespace std;
void square(int *x)
{
*x = (*x)++ * (*x);
}
void square(int *x, int *y)
{
*x = (*x) * --(*y);
}
int main()
{
int number = 30;
square(&number, &number);
cout << number;
return 0;
}
- A.
910
- B.
920
- C.
870
- D.
900
Attempted by 308 students.
Sign up free to check your answer
Sign up freeLoading lesson…

