Chapter:

Arrays-

Write a program in C for multiplication of two square Matrices.

Write a program in C for multiplication of two square Matrices.

#include <stdio.h>
void enterData(int first[][10], int second[][10], int r1, int c1, int r2, int c2);
void multiplyMatrices(int first[][10], int second[][10], int multResult[][10], int r1, int c1, int r2, int c2);
void display(int mult[][10], int r1, int c2);
int main() 
{
    int first[10][10], second[10][10], mult[10][10], r1, c1, r2, c2;
    printf("Enter rows and column for the first matrix: ");
    fflush(stdout);
    scanf("%d %d", &r1, &c1);
    printf("Enter rows and column for the second matrix: ");
      fflush(stdout);
    scanf("%d %d", &r2, &c2);
    // Taking input until columns of the first matrix is equal to the rows of the second matrix
    while (c1 != r2)
     {
        printf("Error! Enter rows and columns again.\n");
        printf("Enter rows and columns for ....
Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-