The code isnt running ...dont know why please help me fix this issue

int main()
{
int arr[1000],n,i,j,k,left,right,maximum_sum,current_sum;
left=-1;
right=-1;
maximum_sum=0;
current_sum=0;
cin>>n;
for(i=0;i<=n-1;i++){
cin>>arr[i];
}

    for(i=0;i<=n-1;i++)
        {
        for(j=i;j<=n-1;j++)
        {
            for(k=i;k<=j;k++)
                current_sum+=arr[k];
        }
        cout<<current_sum<<endl;
    }
    return 0;

}

You can share this code using ide.codingblocks.com

  • A special url will be generated, share that url with me

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.