Consider a 2-by-3 integer array t.

a) Write a declaration for t.
b) How many rows does t have?
c) How many columns does t have?
d) How many elements does t have?
e) Write the names of all the elements in row 1 of t.
f) Write the names of all the elements in column 2 of t.
g) Write a statement that sets the element of t in the first row and second column to zero.
h) Write a series of statements that initialize each element of t to zero. Do not use a loop.
i) Write a nested counter-controlled for statement that initializes each element of t to zero.
j) Write a nested range-based for statement that initializes each element of t to zero.


```
a) array, 2> t;
b) 2
c) 3
d 6
e) t[1][0], t[1][1], t[1][2]
f) t[0][2], t[1][2]
g) t[0][1] = 0;
h) t[0][0] = 0;
t[0][1] = 0;
t[0][2] = 0;
t[1][0] = 0;
t[1][1] = 0;
t[1][2] = 0;
i) for (int i{0}; i < 2; ++i) {
for (int j{0}; j < 3; ++j) {
t[i][j] = 0;
}
}
j) for (auto& row : t) {
j) for (auto& element : row) {
element = 0;
}
}
```

Computer Science & Information Technology

You might also like to view...

Options can be displayed from the ________ view

Fill in the blank(s) with correct word

Computer Science & Information Technology

To view all comments and edits made to a document, as well as statistics regarding the changes made, you can:

A) click Show Markup in the Tracking group on the Review tab. B) open the Simple Markup dialog box. C) open the Reviewing Pane. D) click Compare in the Compare group on the Review tab.

Computer Science & Information Technology

Which statement is true about an omnidirectional antenna?

A) It would commonly be used in a school hallway that has extended length. B) It is a fictitious antenna used for comparison with real antennas for strength measurement. C) It can pick up signals from all around it. D) It would be used as an antenna between two buildings.

Computer Science & Information Technology

A cell with a(n) ____________________ reference contains a formula that refers to its own cell location.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology