lrow - { for (j=0;j<5;j++)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; import java.lang.*; import java.io.*; import java.text.*; import java.math.*; import java.text.DecimalFormat; import java.lang.String; // Jeremy Debruce // 4/15/2009 / public class lrow { static int col,largest,row,n=1,i,j; public static void main(String[] args) { int[][] array = {{23,5,6,15,18}, {4,16,24,67,10}, {12,54,23,76,11}, {1,12,34,22,8}, {81,54,32,67,33}, {12,34,76,78,9}}; System.out.println(" The Array Output"); for (i=0;i<5;i++)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { for (j=0;j&lt;5;j++) System.out.printf(&quot;%5s&quot; ,array[i][j]+&quot; &quot;); System.out.println(); } for(row=0; row &lt; array.length;row++) { largest=array[row][0]; for(col=1; col&lt; array[row].length; col++) if (largest &lt; array[row][col]) largest = array[row][col]; System.out.println(); System.out.println(&quot; The largest element of row &quot; + (row + 1) + &quot; = &quot; + largest); } System.out.println(&quot;Have a nice day&quot;); } }...
View Full Document

Ask a homework question - tutors are online