Compilation
Question 1 |
What error would the following function given on compilation?
f(int a, int b)
{
int a;
a=20;
return a;
}
f(int a, int b)
{
int a;
a=20;
return a;
}
Missing parenthesis is return statement | |
Function should be defined as int f(int a, int b) | |
Redeclaration of a | |
None of these |
Question 1 Explanation:
We are already declared variable name ‘a’ in function. Again we are declared inside the function. So, the compiler will raise a error “Redeclaration of a”