Maximum value of division of two numbers in an Array | C # 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
using System ; class GFG { static int Division ( int [ ] a , int n ) { int maxi = int . MinValue , mini = int . MaxValue ; 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 ) { int [ ] a = { 3 , 7 , 9 , 3 , 11 } ; int n = a . Length ; Console . WriteLine ( Division ( a , n ) ) ; } }