answersLogoWhite

0


Best Answer

#include<stdio.h>

void main()

{

int a[3][3],b[3][3],c[3][3],i,j,k;

clrscr();

printf("Enter elements of A:");

for(i=0;i<=2;i++)

for(j=0;j<=2;j++)

scanf("%d",&a[i][j]);

printf("Enter elements of B:");

for(i=0;i<=2;i++)

for(j=0;j<=2;j++)

scanf("%d",&b[i][j]);

printf("A:");

for(i=0;i<=2;i++)

{

for(j=0;j<=2;j++)

printf("%d ",a[i][j]);

printf("");

//To change line.

}

printf("B:");

for(i=0;i<=2;i++)

{

for(j=0;j<=2;j++)

printf("%d ",b[i][j]);

printf("");

}

k=0;

while(k<=2)

{

for(i=0;i<=2;i++)

{

int sum=0;

for(j=0;j<=2;j++)

sum=sum+a[i][j]*b[j][k];

c[i][k]=sum;

}

k++;

}

printf("Result: ");

for(i=0;i<=2;i++)

{

for(j=0;j<=2;j++)

printf("%d ",c[i][j]);

printf("");

}

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program on matrix multiplication
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

2x2 matrix multiplication program in 8085 processor?

how to write a program for matrix multiplication in microprocesspr


Cannon matrix multiplication program?

maltiplication of matrix for algorithme


Program to display multiplication of two matrix?

The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.


C program for matrix multiplication using dynamic memory alllocation?

Poor boy


Matrix multiplication is not commutative?

That is true, matrix multiplication is not commutative.


What is matrix programming in C programming?

C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion


Are matrix addition and matrix multiplication commutative?

Matrix addition is commutative if the elements in the matrices are themselves commutative.Matrix multiplication is not commutative.


What is matrix multiplication about?

Matrix multiplication typically refers to an operation which yields a new matrix from a pair of matrices which are already known. This is normally covered in an Algebra class or textbook.


Matrix multiplication can be used to rotate figures in the plane.What is the matrix product?

13


How do you write a program of matrix multiplication in a simple way?

you can write by two ways 1 by giving the size of array at declaration 2 by checking condition


How many multiplication there is in strassen's matrix?

7


What is the order of strassen's matrix multiplication?

ghanto