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 

21. Predict the output of below code:

#include<stdio.h>

int main()
{
    int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
    printf("%u, %u\n", a+1, &a+1);
    return 0;
}
  • 65430, 43569
  • 65239, 64763
  • 65480, 65496
  • 61123, 74123

22. Are the expressions arr and &arr same for an array of 10 integers?

  • Yes
  • No

23. Pick out the output

#include <stdio.h>
    int main()
    {
        foo(ary);
    }
    void foo(int **ary)
    {
        int i = 10, k = 10, j = 2;
        int *ary[2];
        ary[0] = &i;
        ary[1] = &j;
        printf("%d\n", ary[0][1]);
    }
  • compile time error
  • Runtime error
  • Output : 20
  • Undefined Behaviour

24. Point the correct statement

  • An array element may be an array by itself
  • Strictly speaking C supports 1-dimensional arrays only
  • Both A and C
  • Array elements need not occupy contiguous memory locations

25. Choose the correct statements

  • An array size can not changed once it is created.
  • Array element value can be changed any number of times
  • To access Nth element of an array students, use students[n-1] as the starting index is 0.
  • None of these