WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS

Answer Posted / abhradeep chatterjee

#include<conio.h>
#include<stdio.h>
void main()
{
int a[2][2],b[2][2],c[2][2];//declare 3 array int type
int i,j,k;

for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
} scanf("%d",&a[i][j]);//inserting element in array a

}
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
} scanf("%d",&b[i][j]);//inserting element in array b

}
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
for(k=;k<2;K++)
{
c[i][j]+=a[i][k]*b[i][j];//multiply of a and b
}
}
}

for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
printf("%d",a[i][j]);//printing element of array c
}
}
}

Is This Answer Correct ?    20 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Should a function contain a return statement if it does not return a value?

601


What are the usage of pointer in c?

708


What is f'n in math?

623


What is #define?

578


What are header files? What are their uses?

642






How do c compilers work?

613


What is data structure in c programming?

576


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

675


What is array of structure in c programming?

759


Can you please explain the scope of static variables?

608


What is the function of multilevel pointer in c?

672


Explain how can I avoid the abort, retry, fail messages?

595


What are volatile variables in c?

525


can we change the default calling convention in c if yes than how.........?

2037


Explain goto?

720