-
What will be the output of the following C code?
#include <stdio.h>
void function(int number[][])
{
number[0][1] = 12;
int k = 0, L = 0;
for (k = 0; k < 2; k++)
for (L = 0; L < 3; L++)
printf("%d", number[k][L]);
}
void main()
{
int number[2][3] = {0};
function(number);
}
-
- 0 12 0 0 0 0
- Garbage value 12 Garbage value Garbage value Garbage value
- Runtime Error
- Compilation Error
- None of these
Correct Option: D
Compilation Error
main.c:2:23: error: array type has incomplete element type ‘int[]’
void function(int number[][])
^~~~~~
main.c:2:23: note: declaration of ‘number’ as multidimensional array must have bounds for all dimensions except the first
main.c: In function ‘main’:
main.c:13:18: error: type of formal parameter 1 is incomplete
function(number);