Home » C Programming » Constants » Question
  1. What will be the output of the following program:-
    #include
    int main()
    {
        const int a=34;
        int b=128;
        a = b;
        printf("%d\n",a);
        return 0;
    }
    
    1. 128
    2. 34
    3. Compiler error
    4. garbage value
Correct Option: C

Compiler marks a as read only, any attemp to modify the value will generate compiler error.



Your comments will be displayed only after manual approval.