Dear candidates you will find MCQ questions of C Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
The correct answer is: (A) Jagged Array
Explanation:
In C language, array dimensions and sizes must be known at compile time for static allocation.
Letβs look at the options:
(A) Jagged Array β β Not possible statically
Example (dynamic jagged array):
int *arr[3];
arr[0] = malloc(2 * sizeof(int)); // 2 elements
arr[1] = malloc(4 * sizeof(int)); // 4 elements
arr[2] = malloc(3 * sizeof(int)); // 3 elements
(B) Rectangular Array β β Possible statically
int arr[3][4]; // 3 rows, 4 columns
(C) Cuboidal Array β β Possible statically
int arr[3][4][5]; // 3 layers of 4x5
(D) Multidimensional Array β β Possible statically
int arr[2][3][4]; // 3D
Final Answer: (A) Jagged Array