C Language MCQ - English
What will happen if in a C program you assign a value to an array element whose
Home | Discussion ForumWhat will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
The element will be set to 0.
The compiler would report an error.
The program may crash if some important data gets overwritten.
The array size would appropriately grow.
Answer : C
View More Related Question
1) What will be printed after execution of the following code?void main()
{
int arr[10] = {1,2,3,4,5};
printf("%d", arr[5]);
}
2) Size of the array need not be specified, when
Initialization is a part of definition
It is a declaratrion
It is a formal parameter
All of these
View Answer
3) What is the maximum number of dimensions an array in C may have?
4) An array elements are always stored in ________ memory locations.
5) Consider the following type definition.
typedef char x[10];
x myArray[5];
What will sizeof(myArray) be ? (Assume one character occupies 1 byte)