Multiple choice

What will be the output of the given program or find out the error if any?

int main()
{    
float  x=fun(2,3);    
printf(%f,x);
}
int fun (int x,float y) //Line 7
{      
x = 20.9;   //Line 9      
return x;
}

  1. 20.99000

  2. 20.00000

  3. 20

  4. 20.9

  5. Error in the program

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

There is an error in the program, so it will not show any output in the main function. Definition of func() is not known to compiler during compilation, so compiler assumed the return type and parameter type to int but in definition. When it sees the parameter type is float, it throws conflicting types error. So this is the correct choice.