Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which of the following for loops will print the column whose subscript is 1 in o

ID: 3556739 • Letter: W

Question

Which of the following for loops will print the column whose subscript is 1 in order (i.e. from top to bottom)

for (int J = 4; J >= 0; J--)
cout << MyArray[J][1] << ' ';

for (int J = 0; J < 5; J++)
cout << MyArray[J][1] << ' ';

for (int J = 4; J >= 0; J--)
cout << MyArray[1][J] << ' ';

for (int J = 0; J < 5; J++
cout << MyArray[1][J] << ' ';

for (int J = 4; J >= 0; J--)
cout << MyArray[J][1] << ' ';

for (int J = 0; J < 5; J++)
cout << MyArray[J][1] << ' ';

for (int J = 4; J >= 0; J--)
cout << MyArray[1][J] << ' ';

for (int J = 0; J < 5; J++
cout << MyArray[1][J] << ' ';

Explanation / Answer

for (int J = 0; J < 5; J++)

cout << MyArray[J][1] << ' ';

//Here Column value is 1 and is constant .it will loop for 4 times. and values at following location are printed

//MyArray[0][1];

//MyArray[1][1];

//MyArray[2][1];

//MyArray[3][1];

//MyArray[4][1];

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote