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

Compilation Error

main.c:8:5: warning: return type defaults to ‘int’ [-Wimplicit-int]
fun()
^~~
main.c:8:5: error: conflicting types for ‘fun’
main.c:2:12: note: previous declaration of ‘fun’ was here
double fun();



Your comments will be displayed only after manual approval.