- #1

- 76

- 0

## Main Question or Discussion Point

**C programming help nedded ??what is the wrong of this code?**

#include<stdio.h>

int matA[3][4],matB[4][3],matAB[3][3],i,j,k;

void read();

void multiply();

void display();

int main()

{

read();

multiply();

display();

return 0;

}

void read()

{

printf("Enter your matrix A:\n");

for (i=0;i<3;i++)

{

for (j=0;j<4;j++)

{

scanf("%d",&matA

*[j]);*

}}

printf("Enter your matrix B:\n");

for (i=0;i<4;i++)

{

for (j=0;j<3;j++)

{

scanf("%d",&matB

}}

printf("Enter your matrix B:\n");

for (i=0;i<4;i++)

{

for (j=0;j<3;j++)

{

scanf("%d",&matB

*[j]);*

}}

}

void multiply()

{

for (i=0;i<3;i++)

{

for (j=0;j<3;j++)

{

matAB}}

}

void multiply()

{

for (i=0;i<3;i++)

{

for (j=0;j<3;j++)

{

matAB

*[j]=0;*

for (k=0;k<4;k++)

{

matABfor (k=0;k<4;k++)

{

matAB

*[j]=matAB**[j]+matA**[k]*matB[k][j];*

}}}}

void display()

{

printf("Here is your multiplied matrix:\n");

for (i=0;i<3;i++);

{

for (j=0;j<3;j++);

{

printf("%d",matAB}}}}

void display()

{

printf("Here is your multiplied matrix:\n");

for (i=0;i<3;i++);

{

for (j=0;j<3;j++);

{

printf("%d",matAB

*[j]);*

}

printf("\n");

}}

i wrote this multiply matA 3*4 by matB 4*3 ...........its compiling but doesn't give me the required output??/it gives me a 0..........i dont know how to find the error ...........im totally stuck can someone please check this code and find the error for me ........}

printf("\n");

}}

i wrote this multiply matA 3*4 by matB 4*3 ...........its compiling but doesn't give me the required output??/it gives me a 0..........i dont know how to find the error ...........im totally stuck can someone please check this code and find the error for me ........