What is the output of the following code fragment?

int array[4][4], index1, index2;
for(index1=0;index1<4;index1++)
for(index2=0;index2<4;index2++)
array[index1][index2]=index1 + index2;
for(index1=0;index1<4;index1++)
{
for(index2=0;index2<4;index2++)
cout << array[index1][index2] << " ";
cout << endl;
}
a. 0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6
b. 0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
c. 0 0 0 0
1 1 1 1
2 2 2 2
3 3 3 3
d. 0 0 0 0
0 1 2 3
0 2 4 6
0 3 6 9


a. 0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6

Computer Science & Information Technology

You might also like to view...

Define a function named swap that exchanges the values of its two type double input/output parameters.

What will be an ideal response?

Computer Science & Information Technology

The ________ property defines whether the datasheet displays above, below, to the left or to the right of the form when using split form

Fill in the blank(s) with correct word

Computer Science & Information Technology

Select the term below which is a protocol that provides a method for software components to communicate, interact, and share data

a. JavaScript b. Application Programming Interface c. Java d. Canvas

Computer Science & Information Technology

A logical unit is designed to manage many physical units.

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

Computer Science & Information Technology