Question: Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}};

Use the sales array to answer. The array was declared using the int sales[2][5] = {{10000, 12000, 900, 500, 20000}, {350, 600, 700, 800, 100}}; statement. 


Which of the following verifies that the array subscripts stored in the row and col variables are valid for the sales array? 

a. if (sales[row][col] >= 0 && sales[row][col] < 5) 

b. if (sales[row][col] >= 0 && sales[row][col] <= 5) 

c. if (row >= 0 && row < 3 && col >= 0 && col < 6) 

d. if (row >= 0 && row <= 1 && col >= 0 && col <= 4)

Step by Step Solution

3.38 Rating (179 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a if sa... View full answer

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 Microsoft Visual C# Introduction Questions!