write the program to find multiplication of 2-D matrix??????????
Answer / keshave12
#include<stdio.h>
void main()
{
int a[10][10],b[10][10],c[10][10],i,j,c1,r1,c2,r2,ir2;
printf("enter the row and column of 1st matrix");
scanf("%d%d",&r1,&c1);
printf("enter the row and column of 2nd matrix");
scanf("%d%d",&r2,&c2);
if(c1==r2)
printf("multiplication can be done");
printf("enter the element of 1st matrix");
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);
printf("enter the element of 2nd matrix");
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);
for(i=0;i<c1;i++)
for(j=0;j<r2;j++)
{
c[i][j]=0;
for(ir2=0;ir2<c1;ir2++)
c[i][j]=a[i][ir2]*[ir2][j];
}
printf("the multiplication of two matrices is:\n");
for(i=0;i<c1;i++)
for(j=0;j<r2;j++)
printf("%3d",c[i][j]);
printf("\n");
getch();
}
| Is This Answer Correct ? | 10 Yes | 6 No |
Is struct oop?
What is the use of define in c?
why we wont use '&' sing in aceesing the string using scanf
what is the difference b/w compiler and debugger?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
a C prog to swap 2 no.s without using variables just an array?
suppose there are five integers write a program to find larger among them without using if- else
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
Why cant I open a file by its explicit path?
If errno contains a nonzero number, is there an error?
Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;