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 

11. Predict the output of below code:

#include<stdio.h>

int main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
    return 0;
}
  • 2,5,15
  • 3, 2, 15
  • 1,2,5
  • 12,15,1

12. What is the value of a[4]?

int a[5]={1,2,4,1,0}

  • 1 .
  • 10 .
  • 0 .
  • Error

13. What is the output of C program with arrays?

int main() 
{ 
int a[3] = {20,30,40}; 
int b[3]; 
b=a; 
printf("%d", b[0]); 
}
  • Compiler Error
  • Output : 20
  • Output : 30
  • Output : 0

14. If a two dimensional array is used as a formal parameter, then

  • the first subscript must be left empty
  • the first (row) subscript may be left empty
  • both the subscripts must be left empty
  • both the subscripts may be left empty

15. applications of a multidimensional array

  • Matrix-Multiplication
  • Minimum Spanning Tree
  • Finding connectivity between nodes
  • All the above