**DOWNLOAD FREE PDF** **<<CLICK HERE>>**

## Data Structure Questions and Answers-Matrix

Congratulations - you have completed *Data Structure Questions and Answers-Matrix*.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%

Your answers are highlighted below.

Question 1 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER] |

What is the order of a matrix?

number of rows X number of columns | |

number of columns X number of rows | |

number of rows X number of rows | |

number of columns X number of columns |

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 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER] |

Which of the following property does not hold for matrix multiplication?

Associative | |

Distributive | |

Commutative | |

None of the mentioned |

Question 2 Explanation:

In matrix multiplication, AB != BA

Question 3 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER] |

How do you allocate a matrix using a single pointer in C?(r and c are the number of rows and columns respectively)

int *arr = malloc(r * c * sizeof(int)); | |

int *arr = (int *)malloc(r * c * sizeof(int)); | |

int *arr = (int *)malloc(r + c * sizeof(int)); | |

int *arr = (int *)malloc(r * c * sizeof(arr)); |

Question 3 Explanation:

Total number of elements in the matrix will be r*c

Question 4 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER] |

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

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 | |

None of the mentioned |

Question 4 Explanation:

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

Question 5 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER] |

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);

Normal of a matrix | |

Trace of a matrix | |

Square of a matrix | |

Transpose of a matrix |

Question 5 Explanation:

Trace of a matrix is the sum of the principal diagonal elements.

Once you are finished, click the button below. Any items you have not completed will be marked incorrect.

There are 5 questions to complete.