You are on page 1of 2

import java.util.

*;

public class matriz4{

public static void main (String[]Args){

int matriza[][] = new int [3][3];

int matrizb[][] = new int [3][3];

int matrizc[][] = new int [3][3];

int i, j;

Scanner dato = new Scanner (System.in);

System.out.println("Datos de la Matriz A :");

for (i=0; i<=2; i++){

for (j=0; j<=2; j++){

System.out.print("Escribir valor " + i + " , " + j + " : ");

matriza [i][j]= dato.nextInt();

System.out.println("Datos de la Matriz A :");

for (i=0; i<=2; i++){

for (j=0; j<=2; j++){

System.out.print("Escribir valor " + i + " , " + j + " : ");

matrizb [i][j]= dato.nextInt();

for (i=0; i<=2; i++){

for (j=0; j<=2; j++){

matrizc [i][j]= matriza[i][j]*matrizb[i][j];

System.out.println("Matriz resultante de la multiplicación :");

for (i=0;i<=2;i++){

for (j=0;j<=2;j++) {

System.out.print(matrizc[i][j] + " ");

System.out.println("");

}
}

run:

Datos de la Matriz A :

Escribir valor 0 , 0 : 1

Escribir valor 0 , 1 : 2

Escribir valor 0 , 2 : 3

Escribir valor 1 , 0 : 1

Escribir valor 1 , 1 : 2

Escribir valor 1 , 2 : 3

Escribir valor 2 , 0 : 1

Escribir valor 2 , 1 : 2

Escribir valor 2 , 2 : 3

Datos de la Matriz A :

Escribir valor 0 , 0 : 1

Escribir valor 0 , 1 : 2

Escribir valor 0 , 2 : 3

Escribir valor 1 , 0 : 1

Escribir valor 1 , 1 : 2

Escribir valor 1 , 2 : 3

Escribir valor 2 , 0 : 1

Escribir valor 2 , 1 : 2

Escribir valor 2 , 2 : 3

Matriz resultante de la multiplicaci n :

149

149

149

BUILD SUCCESSFUL (total time: 1 minute 0 seconds)

You might also like