Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What will happen if the below program is executed?

    int main()
    {
    int main = 3;
    printf("%d", main);
    return 0;
    }
  2. A.
    It will cause a compile-time error
    B.
    It will cause a run-time error
    C.
    It will run without any error and prints 3
    D.
    It will experience infinite looping

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    A C program can have same function name and same variable name.
    $ cc pgm3.c
    $ a.out
    3


Be The First To Comment