10 Questions
What is the correct way to initialize a 2D array in C++ to store roll number and marks obtained by 4 students side by side?
int arr[4][2];
In a 2D array, what does 'r' represent?
Number of rows in the matrix
What does the following C++ code initialize? int arr = { { 1234, 56 }, { 1256, 43 }, { 1434, 32 }, { 1312, 96 } };
It is an invalid initialization for an array
What is the correct syntax to access an element at the third row and second column in a C++ 2D array 'arr'?
arr[2][1]
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a 2D array?
Number of columns in the matrix
What is the correct way to initialize a 2D array in C++ to store roll number and marks obtained by 4 students side by side?
int arr[4][2] = {{101, 85}, {102, 90}, {103, 78}, {104, 92}};
In a C++ 2D array declaration 'datatype array_name[r][c];', what does 'r' represent?
Number of rows in the matrix
What does the following C++ code initialize?
A 2D array with elements {{1234,56},{1256,43},{1434,32},{1312,96}}
In C++, what is the correct syntax to access an element at the third row and second column in a 2D array 'arr'?
arr[2][1]
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a C++ 2D array?
Number of columns in the matrix
This quiz explores the concept of two-dimensional arrays, also called matrices, which have rows and columns. It covers the basic syntax and usage of 2D arrays in programming.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free