what will we do if we want to print the subarray with specific no of elements
like an array has 5 elements and we want to print that subarrays which have only 2 elements
Generating subarrays
thnx that worked if we want the sum of these subarrays will we use another loop and initialize sum at the start of it?
@utkarsh2504 same code just instead of printing calculate sum and print it and initialize 0 to it again
i initialized it with the first element of the subarray was not getting the correct answer with sum=0;