0% found this document useful (0 votes)
3 views5 pages

Problem Solving and Programming(3)

The document outlines an assignment for a C programming task involving operations on 2D arrays (matrices). It includes a menu-driven program to perform matrix addition, multiplication, and transposition, along with a step-by-step algorithm for implementation. The document specifies user input requirements and error handling for invalid choices.

Uploaded by

krishnaramanj618
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Problem Solving and Programming(3)

The document outlines an assignment for a C programming task involving operations on 2D arrays (matrices). It includes a menu-driven program to perform matrix addition, multiplication, and transposition, along with a step-by-step algorithm for implementation. The document specifies user input requirements and error handling for invalid choices.

Uploaded by

krishnaramanj618
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

PROBLEM SOLVING AND

PROGRAMMING
Krishna Ramanbainwad
ET-E BATCH-2 ROLL NO. 36
PRN:12410651
Assignment-7:
Write a menu-driven C program to
perform the following operations on
2D arrays (matrices):
Operations:
1. Addition of two matrices
2. Multiplication of two matrices
3. Transpose of a matrix
Soln :
Algorithim:-
Step 1: Start
Step 2: Display the menu with 3 options:
1. Addition of two matrices
2. Multiplication of two matrices
3. Transpose of a matrix
Step 3: Read user’s choice
Step 4: Based on the choice:
Case 1:
a. Input dimensions (rows and
columns)
b. Input two matrices
c. Add the matrices
d. Display the result
Case 2:
a. Input dimensions of two
matrices
b. Input the matrices
c. If column of 1st ≠ row of 2nd,
print error
d. Else multiply matrices
e. Display result
Case 3:
a. Input dimensions of the matrix
b. Input the matrix
c. Transpose the matrix
d. Display result
Default:
a. Print "Invalid choice"
Step 5: End
Code:-
Output:-

You might also like