Podcast
Questions and Answers
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?
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]; (correct)
- int arr[8];
- int arr[][] = { {1, 85}, {2, 90}, {3, 78}, {4, 92} };
- int arr[2][4];
In a 2D array, what does 'r' represent?
In a 2D array, what does 'r' represent?
- A specific element in the array
- Number of columns in the matrix
- Number of rows in the matrix (correct)
- Total number of elements in the array
What does the following C++ code initialize?
int arr = { { 1234, 56 }, { 1256, 43 }, { 1434, 32 }, { 1312, 96 } };
What does the following C++ code initialize? int arr = { { 1234, 56 }, { 1256, 43 }, { 1434, 32 }, { 1312, 96 } };
- A 1D array with 8 elements
- A 2D array with 4 rows and 2 columns
- A matrix with dimensions 1234x56, 1256x43, 1434x32, and 1312x96
- It is an invalid initialization for an array (correct)
What is the correct syntax to access an element at the third row and second column in a C++ 2D array 'arr'?
What is the correct syntax to access an element at the third row and second column in a C++ 2D array 'arr'?
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a 2D array?
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a 2D array?
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?
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?
In a C++ 2D array declaration 'datatype array_name[r][c];', what does 'r' represent?
In a C++ 2D array declaration 'datatype array_name[r][c];', what does 'r' represent?
What does the following C++ code initialize?
What does the following C++ code initialize?
In C++, what is the correct syntax to access an element at the third row and second column in a 2D array 'arr'?
In C++, what is the correct syntax to access an element at the third row and second column in a 2D array 'arr'?
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a C++ 2D array?
What does 'c' represent in the declaration 'datatype array_name[r][c];' for a C++ 2D array?