Click here to Skip to main content
14,924,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
package Matrix;
import java.util.Scanner;
class Matrix {
  public static void main (String args[]) {
      Scanner input = new Scanner(System.in);
        int m = 0;
        int n = 0;
         int array[][] = {{m},{n}};
        int p = 0;
             int[][] c = new int[array.length][array[0].length];
    int num;
    double[][] ID;
    ID = new double[n][m];
   System.out.println("enter rows:");
   n = input.nextInt();
   System.out.println("enter col:");
   m = input.nextInt();

  System.out.println("enter numbers["+n+"],
              ["+m+"]:");
    for (int row=0; row < n; row++) {
      for (int col=0; col < m; col++) {
   num = input.nextInt();
        }
      }
        int s = 0;
         int array1[][] = {{n},{p}};
     int num1;
    double[][] IDe;
    IDe = new double[n][p];
   System.out.println("enter rows:");
   n = input.nextInt();
   System.out.println("enter col:");
   p = input.nextInt();
   System.out.println("enter numbers["+n+"],
                 ["+p+"]:");
    for (int row=0; row < n; row++) {
      for (int col=0; col < p; col++) {
   num1 = input.nextInt();
        }
      }
    }
 
 for (int i=0; i<m; i++){
   for (int j=0; j<p; j++){
      for (int k=0; k<n; k++){
         c[i][j] += array[i][k]*array1[k][j];

    
        }
      }
     }
}
Posted
Updated 14-Feb-10 5:52am
v3

1 solution

You have asked this question a number of times before, and been given some suggestions. It seems that you are still having trouble understanding arrays, and I would suggest once again that you look at The Java Tutorials[^], and spend some time on the section on arrays, part of Java basics. Until you understand the methodology of creating and accessing arrays and their contents you are unlikely to make much progress with this problem.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900