Home » C Programming » Variables » Question
  1. Will the following C code compile without any error?
    #include <stdio.h>
    int main()
    {
    int n;
    {
    int n;
    for (n = 0; n < 12; n++);
    }
    }
    1. No
    2. Yes
    3. Depends on the C standard implemented by compilers
    4. All of above
    5. None of these
Correct Option: B

There can be blocks inside the block. But within a block, variables have only block scope.



Your comments will be displayed only after manual approval.