Driver program to test above functions
int main ( ) { int arr [ ] = { 2 , 5 , -1 , 7 , -3 , -1 , -2 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; int k = 3 ; cout << SumOfKsubArray ( arr , n , k ) ; return 0 ; }