Data-Type
November 15, 2023Computer-Networks
November 15, 2023Question 1277 – Compilation
What error would the following function given on compilation?
f(int a, int b)
{
int a;
a=20;
return a;
}
Correct Answer: C
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”
Missing parenthesis is return statement
Function should be defined as int f(int a, int b)
Redeclaration of a
None of these
Subscribe
Login
0 Comments