0
Want to take input from User!!!
What changes do i need here in Matrix Multiplication Java I want to take user input in 3 dimensional matrix and show in Matrix C https://code.sololearn.com/c826kdzUXO29/?ref=app
4 Respuestas
+ 1
Hope this helps you
+ 1
import java.util.*;
public class matrixmultiplication {
public static void main(String[] args){
Scanner sc=new Scanner (System.in);
int [] [] a=new int [3] [3];
int [] [] b=new int [3] [3];
int [] [] c=new int [3] [3];
for(int i=0;i<a;i++)
{
for(int j=0;j<b;j++)
{
for(int k=0;k<c;k++)
{
arr[i][j][k]=sc.nextInt();
}
}
}
for(int i=0;i<=2;i++)
for(int j=0;j<=2;j++)
{
a[i][j]=10+i+j;
b[i][j]=20+i+j;
}
System.out.println("Matrix A:");
for(int i=0;i<=2;i++)
{
for(int j=0;j<=2;j++)
System.out.print("\t"+a[i][j]);
System.out.println("\t");
}
System.out.println("\n");
System.out.println ("Matrix B:");
for(int i=0;i<=2;i++)
{
for(int j=0;j<=2;j++)
System.out.print("\t"+b[i][j]);
System.out.println("\
+ 1
Thanx man 😍
0
My pleasure MD Ashik Karim Nayon