Maximum Subarray Sum (Quiz -- Array)

This was the code compiled by me, and it was showing correct output, But while submitting in Coding Blocks IDE, it showed error.

Can you figure out the error in the following code.
Else, Provide me the code with explaination as well.

#include

using namespace std;

int main()
{
int number;

// cout<<"Enter the number of arrays: ";
cin >> number;

int size;

int arr[1000];

int currentSum = 0;
int maximumSum = 0;

for(int i = 0; i < number;i++)
{
    cin >> size;
    
    for (int j = 0; j < size; j++)
    {
        
        cin >> arr[j];
    }
    
    // Kadane's Algorithm for Maximum Sub-Array Sum


   for(int i =0; i<size; i++)
  {
    
            currentSum = currentSum + arr[i];
    
    
            maximumSum = max(currentSum,maximumSum);

   }
    
    
    cout << maximumSum << endl;

}

return 0;

}

i have corrected your mistakes
check once

Modified Code

if you have further doubt in any line feel free to ask

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.