Java Programs

Write a Java program to find the Maximum number?


/* Write a Java Program to find the Maximum Number */
public class Maximum {
     public static void main(String[] args) {
           int[] array = {1,2,34,56,436,3};/* give input here*/
           int Maximum = array[0];       
           for(int i = 0; i<array.length;i++){
                if(Maximum < array[i]){
                     Maximum = array[i];
                }
           }
           System.out.println("Max Number: "+Maximum);
     }
}
    
www.000webhost.com