adplus-dvertising

Welcome to the Arrays and Pointers MCQs Page

Dive deep into the fascinating world of Arrays and Pointers with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Arrays and Pointers, a crucial aspect of Data Structures and Algorithms. In this section, you will encounter a diverse range of MCQs that cover various aspects of Arrays and Pointers, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Data Structures and Algorithms.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Arrays and Pointers. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Data Structures and Algorithms.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Arrays and Pointers. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Arrays and Pointers MCQs | Page 14 of 15

Q131.
If column-major order is used, how is the following matrix stored in memory?
a b c

d e f

g h i
Discuss
Answer: (d).adgbehcfi
Q132.
Which of the following are the uses of matrices?
Discuss
Answer: (d).All of the mentioned
Discuss
Answer: (d).All of the mentioned
Q134.
Matrix A when multiplied with Matrix C gives the Identity matrix I, what is C?
Discuss
Answer: (b).Inverse of A
Q135.
A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
Discuss
Answer: (a).An array of 50 numbers
Discuss
Answer: (b).Container of objects of similar types
Q137.
Let A be a square matrix of size n x n. Consider the following program. What is the expected output?
C = 100
for i = 1 to n do
for j = 1 to n do
{
Temp = A[i][j] + C
A[i][j] = A[j][i]
A[j][i] = Temp - C
}
for i = 1 to n do
for j = 1 to n do
Output(A[i][j]);
Discuss
Answer: (a).The matrix A itself
Q138.
What is the output of the following piece of code?
public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[2]);
System.out.println(arr[4]);
}
}
Discuss
Answer: (a).3 and 5
Q139.
Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A[11, 5] ? Assume row major storage.
Discuss
Answer: (a).560
Q140.
What is the output of the following piece of code?
public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[5]);
}
}
Discuss
Answer: (c).ArrayIndexOutOfBoundsException

Suggested Topics

Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!