C Programming :: C Preprocessor - Discussion
Home > C Programming > C Preprocessor > MCQs Questions Discussion
18 / 34
What will be output of the following "c" code?
#include<stdio.h>
#define SQR(a) a*a
void main ()
{
int x = 5, y;
y = 25/SQR(x);
printf("%d", y);
}
#include<stdio.h>
#define SQR(a) a*a
void main ()
{
int x = 5, y;
y = 25/SQR(x);
printf("%d", y);
}
A25
B1
C0
DCompilation Error
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
TRICK
Here, the #define will replace SQR(x) with x*x. The value given here is X=5. Then,y= 25/SQR(x)= 25/x*x, then apply bodmas rule here so the value of y will be 25. Hence, 25 will be printed.
Read Full Answer
Report Error
Please Login First Click Here