Generating subarrays

please explain how the third for loop works with an example.

hello @shreyasdaga
consider this array

5 3 2 7 9 10 6

let say i=1 and j = 4
then third loop just going from index 1 to index 4 and priniting value present at that indices.
here at index 1 we have 3 so it will be printed then it go to index 2
at index 2 we have 2 so it will be printed then it go to index 3
at index 3 we have 7 so it will be printed then it go to index 4
at index 4 we have 9 so it will be printed then it go to index 5
and becuase 5 > 4 (value of j) 3rd loop will end here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.