
2 Dimensional Array

Quiz
•
Computers
•
University
•
Hard
Rommel Sario
Used 1+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
25 questions
Introduction to Java

Quiz
•
University
20 questions
Data Structures

Quiz
•
University
20 questions
PRA UAS - Dasar Dasar Pemrograman 2023

Quiz
•
University
19 questions
Technotsav'23

Quiz
•
University
15 questions
Common errors in C programming

Quiz
•
University
15 questions
Quiz 2 - CS110

Quiz
•
University
20 questions
C - Strings

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University