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

Answer Posted / akshay sharma

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

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

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


c[i][j]=a[i][j]*b[i][j];

}
}

for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
printf("%d",c[i][j]);
}
}
}

Is This Answer Correct ?    10 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is void pointers in c?

594


Why is c called a structured programming language?

683


Explain what is the difference between text files and binary files?

622


Can you tell me how to check whether a linked list is circular?

781


write a program to copy the string using switch case?

2404






I need a sort of an approximate strcmp routine?

663


Write a program to generate random numbers in c?

666


What is call by value in c?

562


Tell me what is null pointer in c?

617


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

687


Do array subscripts always start with zero?

788


What is type qualifiers?

668


Explain what is the difference between a free-standing and a hosted environment?

637


What is difference between structure and union in c?

551


explain how do you use macro?

670