Online compiler producing different output than my codeblocks ide

Maximum length of biotonic subaray
#include
using namespace std;
int left(int,int []);
int right(int,int [],int);
int main(){
int t;
cin>>t;
while(t–){
int n,a[20],sum=0,max=0,i,k,l,r;
cin>>n;
for(i=0;i<n;++i){
cin>>a[i];
}
for(i=0;i<n;++i){
sum=0;
l=left(i,a);
r=right(i,a,n);
sum=(l+r+1);
if(sum>max)
max=sum;
}

cout<<max<<endl;

   }

return 0;
}
int left(int b,int c[]){
int i,l=0;
if(b==0)
return 0;
for(i=b;i>=0;–i){

    if(c[i]>c[i-1])
        l=l+1;
    else
        break;

}
return l;
}
int right(int b,int c[],int n){
int i,l=0;
if(b==n-1)
return 0;
for(i=b;i<=n-1;++i){

  if(c[i]>c[i+1])
        l=l+1;
  else
    break;
 }

return l;

}

My doubt is solved now

Hello @dsingh200021,

Great, if you have solved it yourself.
In case you still have any doubt regarding same question, let me know.
Otherwise mark this doubt as resolved.:blush:

How to mark this doubt as resolved?

Mark this doubt as resolved in your course’s “ Ask Doubt ” section.

I would mark it resolved myself.No worries.

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.