Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which of the following statements is TRUE? Every element in one multidimensional

ID: 3818214 • Letter: W

Question

Which of the following statements is TRUE? Every element in one multidimensional array must be the same data type but a set of parallel arrays may contain different data types. One multidimensional array may contain a variety of data types but every element in a set of parallel arrays must be the same data type. One multidimensional array may contain a variety of data types and a set of parallel arrays may also contain a variety of data types. Every element in one multidimensional array and every element in a set of parallel arrays must be the same data type. 1 points Save Answer

Explanation / Answer

Ans.

Every element in one multidimensional array must be the same data type but a set of parallel arrays may contain different data types.

since, when we declare a multidimensional array,as below:

type name [size1][size2][size3]......

where,type is any valid data type in c/c++/ etc..

name is valid array name.

example of simple multidimensional array is 2D array, int arr[3][4]. ('3' represents no.of rows and '4' represents no.of columns)

whereas,parallel arrays are set of arrays which are used to represent singular array of 'records'.

which may contain string,integer,charachters.

example in c:

int name={a,b,c};

int marks={90,45,70};

for(i=0;i<3;i++)

{

printf("name%s,marks%d",name[i],marks[i]);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote