:confused:import javax.swing.*;
public class problem3 {
public static void main(String ar[])
{
int array[]={3,5,8,9,18,4,33,67,4,77};
int index = max(array);
JOptionPane.showMessageDialog(null,"the max number is"+index);
}
public static int max(int a[])
{int maxnumber = 0;
for(int x=0; x
{
if (maxnumber < a[x] ) maxnumber=a[x];
}
return maxnumber;
}
}