C Programming MCQ

1:

What error would the following function give on compilation ?

f(int a,int b)
{
int a;
a = 20;
return a;
}

A.

Missing parentheses in return statement

B.

Function should be define as int f(int a,int b)

C.

Redeclaration of a

D.

No error

 

Answer : C

Explanation :

sonali manohar shelke said: (8:19am on Monday 18th December 2017)
As int a is already declared in formal parameter and it again declared inside the function body so option c is correct answer

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.