Multiple choice

Which of the following statements about the given program is correct?

int fun(int, int);
int main()
{    
int x=fun(2,3);
}
fun (int x, int y) //Line 7
{     
int x;         //Line 8     
x = 20;     
return x;      //Line 10
}

  1. Line 7 should be like => int fun (int x, int y)

  2. At line 8 error: ‘x’ redeclared as different kind of symbol

  3. At line 10 error : return of local variable ‘x’

  4. No error

  5. None of the above

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

There is an error.At line 7 in fun (int x, int y) , one definition of x is already present and again we are defining it which throws re-declaration of 'x' error. So this is the correct answer.