Maximum value of division of two numbers in an Array | Java program to maximum value of division of two numbers in an array ; Function to maximum value of division of two numbers in an array ; Traverse through the array ; Return the required answer ; Driver code
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int Division ( int a [ ] , int n ) { int maxi = Integer . MIN_VALUE , mini = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { maxi = Math . max ( a [ i ] , maxi ) ; mini = Math . min ( a [ i ] , mini ) ; } return maxi / mini ; } public static void main ( String [ ] args ) throws java . lang . Exception { int a [ ] = { 3 , 7 , 9 , 3 , 11 } ; int n = a . length ; System . out . print ( Division ( a , n ) ) ; } }