Home » C Programming » Constants » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    #define num 12
    int main()
    {
    const int num = 10;
    printf("num = %d\n", num);
    }
    1. num
    2. num = 12
    3. num = 10
    4. Compilation Error
    5. None of these
Correct Option: D

The #define substitutes a with 12 without leaving any identifier, which results in Compilation error.



Your comments will be displayed only after manual approval.