...
Data-Type
November 15, 2023
Computer-Networks
November 15, 2023
Data-Type
November 15, 2023
Computer-Networks
November 15, 2023

Question 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”
A
Missing parenthesis is return statement
B
Function should be defined as int f(int a, int b)
C
Redeclaration of a
D
None of these
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!