What is the output of the following code fragment?
Int array[4][4],index1,index2;
Forindex1=0;index1<4;index1++)
Forindex2=0;index2<4;index2++)
Array[index1][index2]=index1 + index2;
Forindex1=0;index1<4;index1++)
{
Forindex2=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
Correct Answer:
Verified
Q14: The computer remembers the address of which
Q19: The indexed variables members) of an array
Q21: What is wrong with the following code
Q22: What are the valid indexes for the
Q26: Given an array of integers of size
Q29: An _ is used to process a
Q32: Given an array named scores with 25
Q38: What is wrong with the following code?
Float
Q39: Why should you use a named constant
Q48: Which of the following correctly declare an
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents