Array MCQ Questions and Answers

Home | C Language | Array

Array MCQ Questions and Answers: here learn mcq questions on array in C Language and you can test online mockĀ  exam.

Page: 1/2

1) What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

2) What does the following declaration mean?
int (*ptr)[10];

3) In C, if you pass an array as an argument to a function, what actually gets passed?

4) What is right way to Initialize array?

5) What will be the output of the program ?

void 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);

6) What will be the output of following program code?

#include <stdio.h>
int main(void)
char p;
char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
p = (buf + 1)[5];
printf("%d", p);
return 0;

7) An array elements are always stored in ________ memory locations.

8) What is the maximum number of dimensions an array in C may have?

9) Size of the array need not be specified, when

10) Consider the following type definition.

typedef char x[10];
x myArray[5];

What will sizeof(myArray) be ? (Assume one character occupies 1 byte)