Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2017 – May | Question 40

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 19 Mar, 2018

What is the output of this C++ program?

#include 
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


Answer: (C)

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!