public class part2 {
public static void main(String[] args) {
int[][] a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int[][] b = {{10, 12, 13}, {14, 15, 16}, {17, 18, 19}};
double[][] x = matrix(a, b);
for (int i = 0; i < x.length; i++) {
System.out.println(x[i][i]);
}
}
public static double[][] matrix(int[][] a, int[][] b) {
double[][] c = new double[b.length][b[0].length];
for (int i = 0; i < b.length; i++) {
for (int j = 0; j < b[0].length; j++) {
c[i][j] = (4 * a[i][j]) / (3 * b[i][j]);
}
}
return c;
}
}
I'm stuck with these simple code so I'm trying to access to my method and print out the result can someone please help me about this?
My Result has to be like this 0.13 0.22 0.31,0.38 0.44 0.50,0.55 0.59 0.63 the code has to multiply array a with 4 and array b with 3 then has to devide them to get these results