not getting proper output
I hv written a program to multiply 2 matrices but i m not getting the correct output due to some logical error. code link: https://code.sololearn.com/cJfMHJ1ff6Aw #include<stdio.h> int main() { int i, j,m,n,p,k; int a[10][10],b[10][10],c[10][10]; printf("\n Please Enter Number of rows and columns : "); scanf("%d %d", &m, &n); printf("\n Please Enter Number of rows and columns : "); scanf("%d %d", &p, &k); if(m!=k) { printf("Product not possible!"); } printf("\n Please Enter the Matrix Elements \n"); for(i = 0; i <= m-1; i++) { for(j = 0;j <= n-1;j++) { scanf("%d", &a[i][j]); } } printf("\n Please Enter the Matrix Elements \n"); for(i = 0; i <= p - 1; i++) { for(j = 0;j <= k-1;j++) { scanf("%d", &b[i][j]); } } for(i = 0; i <= m-1; i++) { for(j = 0; j<= p-1;j++) { for(k=0;k<=n-1;k++) { c[i][j]=0; c[i][j]= c[i][j]+a[i][k]*b[k][j]; } } } printf("product of 2 matrices \n"); for(i = 0; i <= m- 1; i++) { for(j = 0;j <= p-1;j++) { printf("%d\t",c[i][j]); } printf("\n"); } return 0; }