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

Compilation Error

main.c: In function ‘main’:
main.c:4:9: warning: implicit declaration of function ‘A’ [-Wimplicit-function-declaration]
A();
^
main.c:5:14: warning: conflicting types for ‘A’
void A()
^
main.c:5:14: error: static declaration of ‘A’ follows non-static declaration
main.c:4:9: note: previous implicit declaration of ‘A’ was here
A();



Your comments will be displayed only after manual approval.