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<5;j++) System.out.printf("%5s" ,array[i][j]+" "); System.out.println(); } for(row=0; row < array.length;row++) { largest=array[row][0]; for(col=1; col< array[row].length; col++) if (largest < array[row][col]) largest = array[row][col]; System.out.println(); System.out.println(" The largest element of row " + (row + 1) + " = " + largest); } System.out.println("Have a nice day"); } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2302 taught by Professor Staff during the Spring '11 term at Kennesaw.

Ask a homework question - tutors are online