main()
{
int matriz1 [3][3], x, y, matriz2[3][3], matriz3[3][3];
for(x=0;x<=2;x++)
for(y=0;y<=2;y++)
{
printf("\nDame el valor del elemento %i %i de la matriz1\n", x,y);
scanf("%i", &matriz1 [x][y]);
}
for(x=0;x<=2;x++)
for(y=0;y<=2;y++)
{
printf("\nDame el valor del elemento %i %i de la matriz2\n", x,y);
scanf("%i", &matriz2 [x][y]);
}
printf("valor de la matriz 3:");
for(x=0;x<=2;x++)
{
printf("\n");
for(y=0;y<=2;y++)
printf("%i", matriz3[x][y]=matriz1[x][y]+matriz2[x][y]);
}
return 0;
getch();
}
No hay comentarios:
Publicar un comentario