Question: public class prac 6 { public static void main ( String [ ] args ) { int [ ] [ ] matrix = new int

public class prac6{
public static void main(String[] args){
int[][] matrix = new int[5][5];
int row_max =0;
int column_max =0;
for (int i =0; i < matrix.length; i++){
for (int j =0; j < matrix[i].length; j++){
matrix[i][j]=(int)(Math.random()*2);
System.out.print(matrix[i][j]);
}
System.out.println("");
}
for (int i =0; i < matrix.length; i++){
int row_sum =0;
for (int j =0; j < matrix[i].length; j++){
row_sum += matrix[i][j];
}
if (row_sum > row_max){
row_max = i;
}
}
for(int j =0; j column_max){
column_max = j;
}
}
System.out.println("The largest row index is: "+ row_max);
System.out.println("The largest column index is: "+
column_max);
}
} Make a FLOWCHART diagram and use proper shapes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!