Driver Code
public static void Main ( string [ ] args ) { int [ ] arr = { 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 } ; int queries = 3 ; int [ , ] q = { { 2 , 4 } , { 2 , 6 } , { 5 , 8 } } ; int n = arr . Length ; for ( int i = 0 ; i < queries ; i ++ ) Console . Write ( findSum ( arr , n , q [ i , 0 ] , q [ i , 1 ] ) + " STRNEWLINE " ) ; } }