Answer to Question #214185 in C++ for Jaguar

Question #214185

QUESTION 30

After the following statements execute, what are the contents of matrix? 

int matrix[3][2]; 

int j, 

for (j = 0; j < 3; j++) 

 for (k = 0; k < 2; k++) 

 matrix[j][k] = j + k; 

1. 0 0 

1 1 

2 2 

2. 0 1 

2 3 

4 5 

3. 0 1 

1 2 

2 3

4. 1 1 

2 2 

3 3


1
Expert's answer
2021-07-11T14:38:34-0400
using namespace std;
#include <stdio.h>

//After the following statements execute, what are the contents of matrix? 
main(void)
{
	int matrix[3][2]; 
	int j,k; 
	cout<<"\n";
	for (j = 0; j < 3; j++) 
	{
		for (k = 0; k < 2; k++) 
		{
			matrix[j][k] = j + k; 
			cout<<"\t"<<matrix[j][k];	
		}
		cout<<endl;
	}
	return(0); 
}






Final Answer: Option [3]


0 1 

1 2 

2 3


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