Question: Complete the following C++ program so that it prints out the numbers in the row indicated by the user input. For example, if row is

Complete the following C++ program so that it prints out the numbers in the row indicated by the user input. For example, if row is 0 that should give the first row of 1 2 3 4 5 as the output.

#include using namespace std; int main(void) { const int size = 5; int row; int arr[size][size] = {{1, 2, 3, 4, 5}, // The interior braces are needed around each row of numbers. Corrected 2/23/2021 {6, 5, 3, 1, 0}, {6, 9, 8, 7, 5}, {1, 4, 7, 9, 2}, {3, 2, 6, 5, 8}}; cout << "Enter a row number from 0 to " << size - 1 << ": "; cin >> row;

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!