Home » C Programming » Arrays » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int Array[2][5];
    Array[][] = {{10, 20, 30, 40, 50}, {40, 50, 60, 70, 80}};
    printf("%d\n", Array[3][4]);
    }
    1. Garbage value
    2. Compilation Error
    3. 30 70
    4. Undefined behaviour
    5. None of these
Correct Option: B

Compilation Error

main.c: In function ‘main’:
main.c:5:15: error: expected expression before ‘]’ token
Array[][] = {{10, 20, 30, 40, 50}, {40, 50, 60, 70, 80}};



Your comments will be displayed only after manual approval.