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

Write a program to print “hello world” without using semicolon?

899


How do you do dynamic memory allocation in C applications?

853


what is the format specifier for printing a pointer value?

795


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

867


Explain what standard functions are available to manipulate strings?

831


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

871


Where static variables are stored in memory in c?

750


How can I find out if there are characters available for reading?

875


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.

3747


When should a type cast not be used?

843


How can you determine the maximum value that a numeric variable can hold?

908


what value is returned to operating system after program execution?

1847


Why is main function so important?

852


Why doesnt long int work?

813


Can you please explain the difference between strcpy() and memcpy() function?

823