Maximum Length Bitonic Subarray

This code shows different output for same input.

Here is the code:

@naazsayma123
there are following mistakes in your code

  1. line 13 should be cin>>arr[j], not i
  2. Change line 27 to inc[i]=(a[i]>=a[i-1])?inc[i-1]+1:1;
  3. change line 30 to dec[i]=(a[i]>=a[i+1])?dec[i+1]+1:1;