Data Structure Questions and Answers-Matrix

 

 Buy/Download all MCQ Ebook   >>>Click Here<<<

Data Structure Questions and Answers-Matrix

Click on any option to know the CORRECT ANSWERS

Question 1
What is the order of a matrix?
A
number of rows X number of columns
B
number of columns X number of rows
C
number of rows X number of rows
D
number of columns X number of columns
UPSC Questions answers

Question 1 Explanation: 
By definition, the order of a matrix is number of rows X number of columns, generally denoted by mXn(not compulsory).

Question 2
Which of the following property does not hold for matrix multiplication?
A
Associative
B
Distributive
C
Commutative
D
None of the mentioned
Library science Questions answers

Question 2 Explanation: 
In matrix multiplication, AB != BA

Question 3
How do you allocate a matrix using a single pointer in C?(r and c are the number of rows and columns respectively)
A
int *arr = malloc(r * c * sizeof(int));
B
int *arr = (int *)malloc(r * c * sizeof(int));
C
int *arr = (int *)malloc(r + c * sizeof(int));
D
int *arr = (int *)malloc(r * c * sizeof(arr));
Arab culture Questions answers

Question 3 Explanation: 
Total number of elements in the matrix will be r*c

Question 4
Select the code snippet which performs matrix multiplication.(a and b are the two given matrices, resultant marix is c)
A

for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k =
B

for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k 
for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k = 
D
None of the mentioned
Home science Questions answers

Question 4 Explanation: 
The corresponding elements from the row and column are multiplied and a cumulative sum is formed.

Question 5
What does the following piece of code do?

for(int i = 0; i < row; i++) { for(int j = 0; j < column; j++) { if(i == j) sum = sum + (array[i][j]); } } System.out.println(sum);
A
Normal of a matrix
B
Trace of a matrix
C
Square of a matrix
D
Transpose of a matrix
Commerce Questions answers

Question 5 Explanation: 
Trace of a matrix is the sum of the principal diagonal elements.

There are 5 questions to complete.

 

 Buy/Download all MCQ Ebook >>>CLICK HERE<<<