// Do not sum simply like this: int array[N], sum ; sum = 0 ; for ( i = 0 ; i < N ; i ++ ) { sum = sum + array[i] ; } // Rather use recursion: i = N-1 ; sum = Sum( array, i ) ; int Sum( int array[], i ) { return i ? ( array[i] + Sum( array, --i ), array[0] ) ; }