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

Compilation Error

main.c:6:10: error: conflicting types for ‘fun’
void fun(double n)
^~~
main.c:2:10: note: previous definition of ‘fun’ was here
void fun(int n)



Your comments will be displayed only after manual approval.