Concentration of juice after mixing n glasses in equal proportion | C # implementation of the approach ; Function to return the concentration of the resultant mixture ; Driver code
using System ; class GFG { static double mixtureConcentration ( int n , int [ ] p ) { double res = 0 ; for ( int i = 0 ; i < n ; i ++ ) res += p [ i ] ; res /= n ; return Math . Round ( res , 4 ) ; } static void Main ( ) { int [ ] arr = { 0 , 20 , 20 } ; int n = arr . Length ; Console . WriteLine ( mixtureConcentration ( n , arr ) ) ; } }