Answer to Question #240614 in C++ for jersonjangerona

Question #240614

Prepare a c++ program of the two-dimensional array of the sample run below:


Sample Run:

              [0]         [1]        [2]     [3]        [4]        [5]

  [0] 

  [1] 

  [2] 

  [3] 

  [4] 

  [5]                    9.5

  [6] 

  [7] 

  [8] 

  [9] 

  [10] 

  [11] 


1
Expert's answer
2021-09-22T06:28:29-0400
#include <iostream>

using namespace std;

int main() {
  for (int i = 0; i <= 11; i++) {
    if (i == 0) {
      cout << "\t";
      for (int j = 0; j <= 5; j++)
        cout << "[" << j << "] ";
    } else if (i == 5) {
      cout << "[5]  9.5";
    } else {
      cout << "[" << i << "]";
    }
    cout << endl;
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS