
2 Dimensional Array
Authored by Rommel Sario
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you declare a 2D array of integers with 3 rows and 4 columns in C?
int matrix(3,4);
int matrix[3][4];
int matrix{3,4};
int matrix(3)[4];
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How can you access the element in the second row and third column of the matrix
int matriz[3][3];?
matriz[2][3]
matriz[1][2]
matriz[3][2]
matriz[2][1]
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
int matrix[2][2] = { {1, 2}, {3, 4} };
printf("%d", matrix[1][0]);
1
2
3
4
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How is a 2D array stored in memory?
Column-major order
Row-major order
Random memory allocation
Stored separately in different locations
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will happen if you try to access matrix[3][2] in
int matrix[3][3];?
It will return garbage value
It will give a segmentation fault
It will return 0
It will run normally
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the correct way to iterate over a 3×3 matrix?
for(int i=0; i<3; i++)
for(int j=0; j<3; j++) printf("%d ", matrix[i][j]);
for(int i=0; i<3; j++) for(int j=0; i<3; i++) printf("%d ", matrix[i][j]);
for(int i=0; i<=3; i++) for(int j=0; j<=3; j++) printf("%d ", matrix[i][j]);
for(int i=1; i<=3; i++) for(int j=1; j<=3; j++) printf("%d ", matrix[i][j]);
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following correctly initializes a 3×3 matrix with zero values?
int matrix[3][3] = {0};
int matrix[3][3] = {{0}};
int matrix[3][3] = { {0,0,0}, {0,0,0}, {0,0,0} };
All of the choices
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Programming Concepts in C - Quiz-II
Quiz
•
University
20 questions
Enviro Quizizz 2021
Quiz
•
University
18 questions
PBO Inheritance Episode 2
Quiz
•
University
15 questions
PWEB XII RPL
Quiz
•
University
20 questions
CUESTIONARIO
Quiz
•
University
18 questions
AI 900 - pt 1
Quiz
•
University
18 questions
Lenguaje de Definición de Datos
Quiz
•
University
17 questions
Productos Multimedia Final
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade