Cummulative Sum - Subarray

Couldnt understand how this for loop is working.
Can someone explain what is actually happening in this step
currentSum = cs[j]-cs[i-1];
#include
using namespace std;

int main(){
    int arr[100];
    int cs[100] = {0};
    int currentSum;
    int maximumSum=0;

    //Size of array
    int n;
    cin>>n;

    cin>>arr[0];
    cs[0] = arr[0];

    for(int i=1;i<n;i++){
        cin>>arr[i];
        cs[i] = cs[i-1]+arr[i];
        cout<<cs[i]<<" ";
    }
    cout<<endl;

    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            currentSum = 0;
            currentSum = cs[j]-cs[i-1];
            cout<<currentSum<<" ";
            if(currentSum>maximumSum){
                maximumSum=currentSum;
            }
        }
    }
    cout<<maximumSum;
}

@F19APP0005 hey Ayush there is some problem in this video solution you can refer this solution this. if any query comes please feel free to ask.

int s = i>0? cumulative_sum[j] - cumulative_sum[i-1] : cumulative_sum[j];
I could not understand this concept. Why we wrote j before i and what is actually happening here? What logic is used?

@F19APP0005 it is cs array which store the cummulative sum
suppose
the array of cummulative sum array like that
-4 -3 0 -2 4 6 5 1 -6
index= 0 1 2 3 4 5 6 7 8
if i want to calculate sum of subarray from index i= 1 here j running from j=1 to j=5
so i > 0
here i =1
so cummulative_sum[1]-cummulative_sum[0];
so sum is nothing but 6-(-4)=10
dry run on it