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

What is the use of bitwise operator?

910


What is function and its example?

929


Can a local variable be volatile in c?

793


Is boolean a datatype in c?

801


How do you use a pointer to a function?

885


What is wrong in this statement?

842


Do character constants represent numerical values?

1104


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

857


Explain null pointer.

845


What is the difference between break and continue?

1026


How can I get random integers in a certain range?

826


What are all different types of pointers in c?

802


Can we increase size of array in c?

747


Explain what’s a signal? Explain what do I use signals for?

826


Write a program for finding factorial of a number.

873