Regarding maximumSum assignment problem

#include
using namespace std;
int main(){
int t;
cin>>t;
if(t>=1 and t<=20){
while(t–){
int n;
cin>>n;
int a[1000];
int maximumSum=0;
int currentSum=0;
// int cumSum[100]={0};

for(int i=0;i<n;i++){
    cin>>a[i];
}


for (int i=0;i<n;i++){
    currentSum+=a[i];
    if(currentSum<0){
        currentSum=0;
    }
    if(currentSum>maximumSum){
        maximumSum=currentSum;
    }
}
cout<<maximumSum<<endl;
  
 
}
}
return 0;

}
In this code it shows run error ,I couldn’t identify it.please help me.

Hi Raushan, please save your code on ide.codingblocks.com and share the link here please so that we can help you out asap.

Hey Raushan,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.