-
What will be the output of the following C code?
#include
void f(int n[5][])
{
n[0][4] = 11;
int k = 0, L = 0;
for (k = 0; k < 4; k++)
for (L = 0; L < 5; L++)
printf("%d", n[k][L]);
}
void main()
{
int n[4][5] = {0};
f(n);
}
-
- Garbage value Garbage value 11 Garbage value Garbage value
- Only garbage value
- Runtime Error
- 11
- Compilation Error
Correct Option: E
Compilation Error
main.c:2:16: error: array type has incomplete element type ‘int[]’
void f(int n[5][])
^
main.c:2:16: note: declaration of ‘n’ as multidimensional array must have bounds for all dimensions except the first
main.c: In function ‘main’:
main.c:13:11: error: type of formal parameter 1 is incomplete
f(n);