Vidyalelo
C Programming · Q40

C Preprocessor

Programming · C Programming · question 40

Q40

What will be output if you will compile and execute the following c code? #include #define max 5 void main() int i = 0; i = max++; printf("%d", i++);

A.
5
B.
6
C.
7
D.
0
E.
Compiler Error
Answer

Answer: Option E

Solution

Answer: Option E
Solution:
main.c: In function ‘main’:
main.c:5:12: error: lvalue required as increment operand
i = max++;