Answer to Question #214184 in C++ for Jaguar

Question #214184

QUESTION 28

Consider the following statement: 

int alpha[25][10];. 

Which of the following statements about alpha is true? 

1. Rows of alpha are numbered 0...24 and columns are numbered 0...9.

2. Rows of alpha are numbered 0...24 and columns are numbered 1...10.

3. Rows of alpha are numbered 1...24 and columns are numbered 0...9.

4. Rows of alpha are numbered 1...25 and columns are numbered 1...10.

QUESTION 29

Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the 

element type int? 

1. int alpha[4][3] = {{0,1,2} {1,2,3} {2,3,4} {3,4,5}};

2. int alpha[4][3] = {0,1,2; 1,2,3; 2,3,4; 3,4,5};

3. int alpha[4][3] = {0,1,2:1,2,3:2,3,4:3,4,5};

4. int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};



1
Expert's answer
2021-07-11T14:38:43-0400

QUESTION 28

The true statement is:

1. Rows of alpha are numbered 0...24 and columns are numbered 0...9.

This is because the indices of an array starts from 0 to n-1. Hence row will be 0 to 24 and column 0 to 9.


QUESTION 29

The correct statement is :

4. int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};


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