Write the code that represents the following array using a vector:

```
int matrix[4][4] =
{{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16}};
```


```
vector< vector > matrix(4); // four rows

for (int i = 0; i < 4; i++)
matrix[i] = vector(4);

matrix[0][0] = 1; matrix[0][1] = 2; matrix[0][2] = 3; matrix[0][3] = 4;
matrix[1][0] = 5; matrix[1][1] = 6; matrix[1][2] = 7; matrix[1][3] = 8;
matrix[2][0] = 9; matrix[2][1] = 10; matrix[2][2] = 11; matrix[2][3] = 12;
matrix[3][0] = 13; matrix[3][1] = 14; matrix[3][2] = 15; matrix[3][3] = 16;
```

Computer Science & Information Technology

You might also like to view...

Suppose your target audience uses a broadband connection with a speed of 6 Mbps. What is the maximum file size for your 30-second video to have a smooth playback using pseudostreaming on the Web? Show your calculations.

What will be an ideal response?

Computer Science & Information Technology

A mask layer hides the contents of the layer below it, called the invisible layer.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Programs and applications enable you to use a computer without the need for special programming skills

Indicate whether the statement is true or false

Computer Science & Information Technology

The first element in an array is addressed using an index of 1.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology