Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    void funA();
    void funB()
    {
    funA();
    }
    funB();
    }
    void FunA()
    {
    printf("Interview Mania");
    }
    1. Compilation Error
    2. Interview Mania
    3. Garbage value
    4. Depends on the compiler
    5. None of these
Correct Option: D

Even though the answer is 2, this code will compile fine only with gcc. GNU C supports nesting of functions in C as a language extension whereas standard C compiler doesn’t.



Your comments will be displayed only after manual approval.