Skip to main content

Posts

Showing posts with the label C Program for Matrix Multiplication

C Program for Matrix Multiplication or Matrix Multiplication in C Example Source Code

C Program for Matrix Multiplication or Matrix Multiplication in C Example Source Code given below: Matrix Multiplication Example 1 :- #include<stdio.h> #include <conio.h> #include <stdlib.h> main() { int m, n, p, q, c, d, k, sum = 0; int first[10][10], second[10][10], multiply[10][10]; clrscr(); // first clear the screen printf("Enter the number of rows and columns of first matrix\n"); scanf("%d%d",&m,&n); printf("Enter the number of rows and columns of second matrix\n"); scanf("%d%d",&p,&q); if ( n != p ) { printf("Sorry! Matrix Multiplication can't be done, study row col combination of Matrices...\n"); getch(); // uses wait comand and in conio.h exit(0); // to exit program and in stdlib.h } printf("Enter the elements of first matrix\n"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) ...