Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. Does this compile without error?

    int main()
    {
    int k;
    {
    int k;
    for (k = 0; k < 10; k++);
    }
    }
  2. A.
    Yes
    B.
    No
    C.
    Depends on the compiler
    D.
    Depends on the C standard implemented by compilers

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    There can be blocks inside block and within blocks variables have only block scope.
    Output:
    $ cc pgm5.c


Be The First To Comment