Sir what is wrong in this code?

#include
#include
using namespace std;
int max_sum( int a[], int n)
{
int M=0,curr_sum=0;
for(int i=0;i<n;i++)
{
curr_sum=curr_sum+a[i];
if(curr_sum<0)
{
curr_sum=0;
}
M=max(M,curr_sum);
}
return M;
}
int main() {
int t;
cin>>t;
while(t>0){

  int  N,a[10000];
  cin>>N;
  for(int i=0;i<N;i++)
  {
	 cin>>a[i];
  }
  cout<<max_sum(a,N)<<endl;
  t--;
}

return 0;

}

@Harshit-Kumar-2577121455897279 you should take your array size as 10^5 as N can be upto 10^5.

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.