38. Write the statement to do the following:
– create a two-dimensional array called orders
– each element will be of the int data type
– there will be 2 rows and 3 columns
– each element will be initialized to 0
39. If a two-dimensional array declard to be of the int data type was very large and you wished to initialize all of the
elements of the array to something other than 0 (for example, 99), it would be quite exhausting to code all of the initial
values. Write a nested loop using two for loops to initialize all of the elements in the array below to 99. Use row and col
for your loop variables.
int scores[100][100] = {0};
40. Write the statement to do the following:
– create a two-dimensional array called letters
– each element will be of the char data type
– there will be 2 rows and 2 columns
– each element will be initialized to ‘x’
41. In order to access each element efficiently in a two-dimensional array, you would need a nested loop structure. What
types of loops would you use and why?
42. Given the declaration below, code the statement to assign the element in the first row and first column a value of 99.
int scores[3][2] = {0};
43. Given the declaration below, code the statement to assign the element in the last row and last column a value of 99.
int scores[6][7] = {0};
44. Write the statement to do the following:
– create a two-dimensional array called scores
– each element will be of the int data type
– there will be 3 rows and 2 columns
– each element will be initialized to 100
45. Given the declarations below, write a nested loop using two for loops to sum all of the elements in the array below.
Use row and col for your loop variables.
int scores[3][3] = { {92, 87, 91}, {88, 72, 93}, {100, 94, 97} };
int sum = 0;
46. Given the declaration below, code the statement to assign the element in the first row and first column the value
entered by the user through the prompt below.
int scores[3][2] = {0};
cout << “Please enter the first score: “;
_____________________________