## Help authour, Buy PDF Ebook
>>>**Click Here**<<<

## Data Structure Questions and Answers-Matrix

Question 1 |

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 |

**NTA NET 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?

Associative | |

Distributive | |

Commutative | |

None of the mentioned |

**Microbiology 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)

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

**UPSC GS 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)

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 |

**Aptitude test 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);

Normal of a matrix | |

Trace of a matrix | |

Square of a matrix | |

Transpose of a matrix |

**UPSC GS Questions answers**

Question 5 Explanation:

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

There are 5 questions to complete.