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 are the types of unary operators?

667


Give differences between - new and malloc() , delete and free() ?

616


Differentiate between null and void pointers.

637


What is the use of the function in c?

608


What is union and structure in c?

624






What is variable and explain rules to declare variable in c?

560


Why c is called top down?

637


What is a good way to implement complex numbers in c?

600


Differentiate between a structure and a union.

773


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2664


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2871


What is an identifier?

632


What is "Duff's Device"?

707


Hi can anyone tell what is a start up code?

1625


Using which language Test cases are added in .ptu file of RTRT unit testing???

3605