Loading, please wait...

C Programming Array's Multiple Choice Questions And Answers

Search here for MCQs

Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:

List of Programming Full Forms 

16. Predict the output of below code:

 #include <stdio.h>
    int main()
    {
        int ary[2][3][4], j = 20;
        ary[0][0] = &j;
        printf("%d\n", *ary[0][0]);
    }
  • Junk Value
  • No output
  • Compile time Error
  • Address of j

17. Predict the output of below code:

#include<stdio.h>

int main()
{
    int arr[5], i=0;
    while(i<5)
        arr[i]=++i;

    for(i=0; i<5; i++)
        printf("%d, ", arr[i]);

    return 0;
}
  • 1,2,3,4
  • Garbage value, 1, 2, 3, 4,
  • 2,4
  • none of these

18. Array base address in C language

  • Base address is the address of 0th index element.
  • An array b[] base address is &b[0]
  • An array b[] base address can be printed with printf("%d", b);
  • None of the above

19. C does no automatic array bound checking. This is

  • True.
  • False.
  • C's asset
  • C's shortcoming

20. If n has the value 3, then the statement

  • assigns 4 to a [4]
  • what is assigned is compiler-dependent
  • assigns 4 to a [5]
  • assigns 4 to a [6]