C++ output type question
Q. Trace the output.
#include< iostream.h>
# define SQUARE(x) x*x
inline float square(float y)
{
return y*y;
}
int main( )
{
float a = 0.5, b = 0.5, c, d;
c = SQUARE(++a);
d = square(++b);
cout << c << endl << d;
return 0;
}
- Published on 17 Jun 15a. 6.25, 2.25
b. 2.25, 2.25
c. Compile time error.
d. None of the above.
ANSWER: 6.25, 2.25