What will be the output of the following C code?
#include <stdio.h>
(sizeof double = 8, float = 4, void = 1)
#define PI 3.14
int main()
{
printf("%d", sizeof(PI));
}
#include <stdio.h>
(sizeof double = 8, float = 4, void = 1)
#define PI 3.14
int main()
{
printf("%d", sizeof(PI));
}
A. Output is 8
B. Output is 4
C. Output is 1
D. Error, we can't use sizeof on macro-definitions
Answer: Option A
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion