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
function Division ( a , n ) { let maxi = Number . MIN_VALUE , mini = Number . MAX_VALUE ; for ( let i = 0 ; i < n ; i ++ ) { maxi = Math . max ( a [ i ] , maxi ) ; mini = Math . min ( a [ i ] , mini ) ; } return parseInt ( maxi / mini ) ; } let a = [ 3 , 7 , 9 , 3 , 11 ] ; let n = a . length ; document . write ( Division ( a , n ) ) ;