Matrix_Operations_Microproject
Matrix_Operations_Microproject
Objective
To implement a C program that performs Addition, Subtraction, and Multiplication of two matrices
Materials Required
- Computer with a C compiler (like GCC)
#define SIZE 10
printf("Enter elements:\n");
scanf("%d", &matrix[i][j]);
printf("\n");
}
}
void addMatrices(int a[SIZE][SIZE], int b[SIZE][SIZE], int res[SIZE][SIZE], int row, int col) {
void subtractMatrices(int a[SIZE][SIZE], int b[SIZE][SIZE], int res[SIZE][SIZE], int row, int col) {
void multiplyMatrices(int a[SIZE][SIZE], int b[SIZE][SIZE], int res[SIZE][SIZE], int row1, int col1, int
col2) {
res[i][j] = 0;
int main() {
printf("Matrix A:\n");
printf("Matrix B:\n");
printf("Addition of matrices:\n");
printf("Subtraction of matrices:\n");
} else {
if (col1 == row2) {
printf("Multiplication of matrices:\n");
displayMatrix(result, row1, col2);
} else {
return 0;
Conclusion
This microproject demonstrates the use of 2D arrays for performing basic matrix operations. It
strengthens understanding of nested loops and array manipulation, which are fundamental in