Write a program in C++ which takes two 4 x 4 matrices as input from the user and displaysthe matrices in tabular form. Then ask user to make a choice:1. Press 1 for matrix addition2. Press 2 for...


Write a program in C++ which takes two 4 x 4 matrices as input from the user and displays
the matrices in tabular form. Then ask user to make a choice:
1. Press 1 for matrix addition
2. Press 2 for matrix subtraction
3. Press 3 for matrix multiplication
4. Press 4 for matrix transpose
Use 2D arrays to save matrix values and use functions to perform addition, subtraction,
multiplication and transpose. Refer below examples to understand the concept of matrix
operations.


Example of matrix multiplication:<br>Matrix multiplication<br>5 20<br>15 46<br>|1<br>1*5 + 2*0 1*6 + 2*7<br>3<br>4<br>0 7<br>3*5 + 4*0 3*6 + 4*7<br>Example of matrix transpose:<br>1<br>2 3<br>1 4<br>7<br>4 5 6<br>2 5 8<br>7 8 9<br>3 6 9<br>Input<br>Output<br>

Extracted text: Example of matrix multiplication: Matrix multiplication 5 20 15 46 |1 1*5 + 2*0 1*6 + 2*7 3 4 0 7 3*5 + 4*0 3*6 + 4*7 Example of matrix transpose: 1 2 3 1 4 7 4 5 6 2 5 8 7 8 9 3 6 9 Input Output
Example of matrix addition:<br>4 8<br>1<br>4+1<br>8+ 0<br>3 7<br>3+ 5 7+2<br>Example of matrix subtraction:<br>Matrix subtraction<br>1 2<br>1<br>3]<br>–1<br>[3 4] s_s]¯l-2 -i|<br>5<br>

Extracted text: Example of matrix addition: 4 8 1 4+1 8+ 0 3 7 3+ 5 7+2 Example of matrix subtraction: Matrix subtraction 1 2 1 3] –1 [3 4] s_s]¯l-2 -i| 5

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here