Sunday 12 December 2010

Flow chart for To perform the addition and multiplication of two matrices



Description:


program takes the two matrixes of same size and performs the addition an also takes the two matrixes of different sizes and checks for possibility of multiplication and perform multiplication if possible.





Output:

1.
************************************
MENU
**********************************
[1]ADDITION OF TWO MATRICES [2]MULTIPLICATION OF TWO MATRICES [0]EXIT
**********************************
Enter your choice:
1
Valid Choice
Input rows and columns of A & B Matrix:2 2
Enter elements of matrix A: 2 2 2 2

Enter elements of matrix B: 2 2 2 2

=====Matrix Addition=====
4
4




47

************************************ 
MENU 
********************************** 
[1]ADDITION OF TWO MATRICES [2]MULTIPLICATION OF TWO MATRICES [0]EXIT 
********************************** 
Enter your choice: 
Valid Choice 
Input rows and columns of A matrix:2 3 
Input rows and columns of B matrix:2 2 
Matrices cannot be multiplied. 

************************************
MENU
**********************************
[1]ADDITION OF TWO MATRICES [2]MULTIPLICATION OF TWO MATRICES [0]EXIT
**********************************
Enter your choice:
2
Valid Choice
Input rows and columns of A matrix:2 2
Input rows and columns of B matrix:2 2
matrices can be multiplied resultant matrix is 2*2 
Input A matrix

2
2
2
Input B matrix 
2
2
   2

=====Matrix Multiplication===== Resultant of two matrices:

8
8








Conclusion : The program is error free


VIVA QUESTIONS:

1)  What is condition for performing an matrix addition ?
Ans: program takes the two matrixes of same size and performs the addition 

2) What is condition for performing an matrix multiplication ?
Ans: The two matrixes of different sizes are checked for possibility of multiplication and perform multiplication if possible






Arrays

No comments:

Post a Comment