Home » C Programming » Arrays » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n[2][3];
    function(n);
    }
    void function(int *n[])
    {
    int num1 = 20, num2 = 23, L;
    n[0] = &num1;
    n[1] = &num2;
    *n[0] = 23;
    for (L = 0; L < 2; L++)
    printf("%d\n", *n[L]);
    }
    1. Garbage value
    2. Compilation Error
    3. 23
      23
    4. Runtime Error
    5. Undefined behaviour
Correct Option: C

23
23



Your comments will be displayed only after manual approval.