package Scanner; import java.util.Scanner; public class max { public static void main(String [] args){ int[] arr=new int[3]; Scanner sc=new Scanner(System.in); System.out.println("please code 1"); arr[0]=sc.nextInt(); System.out.println("please code 2"); arr[1]=sc.nextInt(); System.out.println("please code 3"); arr[2]=sc.nextInt(); int max=arr[0]; int i=1; for(;i<=arr.length-1;i++){ if(max<arr[i]){ max=arr[i]; } } System.out.println(max); } }
max