<code> //In c++ The first code below needs to be to rewrote for column by column
ID: 3635363 • Letter: #
Question
<code>
//In c++ The first code below needs to be to rewrote for column by column
for (int row = 0; row < 4; row += 1)
for (int col = 0; col < 6; col += 1)
cout << balances[row][col] << endl;
//end for
//end for
<code>
I have this for column by column
<code>
#include <iostream>
using namespace std;
int main()
{
int nums[4][6] = {{17, 24, 86, 35},
{23, 36, 10, 12}};
//display column by column
cout << endl;
//display row by row
system("pause");
return 0;
} //end of main function
<code>
Thanks
Explanation / Answer
//In c++ The first code below needs to be to rewrote for column by column
//end for
//end for
I have this for column by column
<code>
#include <iostream>
using namespace std;
int main()
{
int nums[4][6] = {{17, 24, 86, 35},
{23, 36, 10, 12}};
//display column by column
for (int col = 0; col < 6; col += 1)
for (int row = 0; row < 4; row += 1)
cout << balances[row][col] << endl;
cout << endl;
//display row by row
for (int row = 0; row < 4; row += 1)
for (int col = 0; col < 6; col += 1)
cout << balances[row][col] << endl;
system("pause");
return 0;
} //end of main function
<code>
Thanks
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.