Multiple choice

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; 
}

What will be the output of the above code?

  1. 20.99

  2. 20.00

  3. No output

  4. Error

  5. 20

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

In main function, definition of func() is not know to the compiler during compilation so it will assume the return type and parameter type to int,  but in definition when it sees the parameter type is float, it throws an error.