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

What are the advantages of external class?

834


What is the code in while loop that returns the output of given code?

1686


Explain what does it mean when a pointer is used in an if statement?

863


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1909


Calculate 1*2*3*____*n using recursive function??

1791


Is it better to use malloc() or calloc()?

877


How the c program is executed?

897


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2572


What is the use of c language in real life?

812


What is binary tree in c?

884


Why is c called a mid-level programming language?

994


Why static is used in c?

870


How can I do peek and poke in c?

880


What is the difference between fread and fwrite function?

882


What are the differences between new and malloc in C?

860