Home / C Programming / Arrays :: Discussion

Discussion :: Arrays

  1. What will be the output of the following code?

    void main()

    {

    int a[10];

    printf("%d %d", a[-1], a[12]);

    }

  2. A.

     0 0

    B.

     Garbage value 0

    C.

     0 Garbage Value

    D.

     Garbage vlaue Garbage Value

    E.

     Code will not compile

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    In c compiler does not check array with its bounds, value at the computed location is displayed.


Be The First To Comment