Home / C Programming / C Preprocessor :: Discussion

Discussion :: C Preprocessor

  1. What will be output if you will compile and execute the following c code?

    #include<stdio.h>

    #define max 5

    void main(){

    int i = 0;

    i = max++;

    printf("%d", i++);

    }

  2. A.

     5

    B.

     6

    C.

     7

    D.

     0

    E.

     Compiler Error

    View Answer

    Workspace

    Answer : Option E

    Explanation :

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


Be The First To Comment