Sample C Program : Addition , Subtraction and Multiplication of Matrices, This program receives input of two matrices and performs the basic operations>/p>

/* Addition , Subtraction and Multiplication of Matrices */ #include<stdio.h> /*Getting the element of the Matrix1 */"Enter the order of first matrix\n"); scanf("%d %d""%d %d""\n Enter the element of first matrix\n""%d", &a[i][j]); } /*Getting the element of the Matrix2 */"\n Enter the order of second matrix\n"); scanf("%d %d ""%d %d\n""\n Enter the element of second matrix\n""%d""\n"); /* Displaying Matrix1 and Matrix2 */"\n\t\t Addition, Subtraction, Multiplication of Matrixes\n\n""First matrix:\n""\t%d""\n""\n""Second Matrix: \n""\t%d""\n"/*Checks whether the orders of the Matrixes are equal */ { add(a,b,m,n); /*If equal sends to the functions add & mul *//* If columns(Mat.1) = Rows (Mat.2) it Multiplication only possible */"\n Addition and Subtraction not possible with this order""\n The order of the matrix are not proper""\n\t The product: \n""\t\t %d""\n\n""\n""\t The sum:\n""\t%d\t""\n\n""\t The difference:\n""\t%d\t""\n\n"); } }