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

Answer Posted / shubham singh

#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
}
}
}//main close

Is This Answer Correct ?    29 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have function or method?

592


What are the advantages of Macro over function?

1207


List some basic data types in c?

561


plz let me know how to become a telecom protocol tester. thank you.

1743


What is function prototype in c language?

617






What is declaration and definition in c?

526


Write a code to determine the total number of stops an elevator would take to serve N number of people.

731


What does char * * argv mean in c?

625


How many header files are in c?

554


Is there a way to compare two structure variables?

617


How do you convert strings to numbers in C?

711


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

610


Why is #define used?

791


Why is struct padding needed?

634


What is #pragma statements?

592