This is the 1st one,i think at least,take a look:
Code:
#include "stdio.h"
#include "conio.h"
void main()
{
static int a[10] [10];
static int b[10] [10];
static int c[10] [10];
int i,j,k,l,m,n,p,q;
clrscr();
printf ("Ponga las dimensiones para el arreglo A filas x columnas \n");/*Dimensions Array for Matrix A*/
scanf ("%d %d",&m,&n);
printf ("Ponga las dimensiones para el arreglo B filas x columnas \n");/*Dimensions Array for Matrix B*/
scanf ("%d %d",&p,&q);
if (n!=p)
{
printf("Multiplicacion de matrices no es posible\n");
printf ("Dimension de matrices no es valida");
}
else
{
printf ("Introduzca los elementos en el arreglo A \n");/*Reading the arrays for matrix A*/
for (i=0; i<m; i++)
{
for (j=0; j<n; j++)
{
scanf ("%d",&a[i] [j]);
}
}
printf("\nEl arreglo A es el siguiente: \n");/*prints on screen matrix A*/
for(i=0; i<m; i++)
{
for(j=0;j<n;j++)
{
printf("%d ", a[i][j]);
}
printf("\n");
}
printf ("\nIntroduzca los elementos en el arreglo B \n");/*Reading the arrays for matrix A*/
for (k=0; k<p; k++)
{
for (l=0; l<q; l++)
{
scanf ("%d",&b[k] [l]);
}
}
printf("\nEl arreglo B es el siguiente: \n");/*prints on screen matrix B*/
for(k=0;k<p;k++)
{
for(l=0;l<q;l++)
{
printf("%d ", b[k][l]);
}
printf("\n");
}
for (i=0; i<m; i++)
{
for (l=0; l<q; l++)
{
for (j=0; j<n; j++)
{
c[i] [l] = c[i] [l] + a[i] [j] * b[j] [l];
}
}
}
clrscr();
printf("\n");
printf("El resultado de la multiplicacion es el sig: \n");/*Printing of result of the multiplication*/
for (i=0; i<m; i++)
{
l=0;
while (l<q)
{
printf (" %d ",c[i] [l]);
l++;
}
printf ("\n");
}
}
getch();
}
Sorry it's in spanish, im from latinamerica