Driver code to run above function
public static void main ( String arg [ ] ) { int a [ ] = { 1 , 2 , 3 , 4 , 5 } ; int n = a . length ; System . out . print ( Math . round ( procal ( n ) * 1000000.0 ) / 1000000.0 ) ; } }