Can you check the error

#include
#include
using namespace std;

int main() {

int t;
cin>>t;
for(int q=0;q<t;q++)
{	
	int n;
	cin>>n;
	int a[1000]={0};
	for(int i=0;i<n;i++)
	{
		cin>>a[i];        
	}
	int isincreasing=1;
	int isdecreasing=1;
	int isincreasingthandecreasing=1;
	bool isdecreasingbool=false;
	int maxinc=0,maxdec=0,maxid=0;
	
	for(int i=1;i<n;i++)
	{
		if(a[i]>a[i-1])
		{
			isincreasing++;
			isdecreasing=1;
			if(isdecreasingbool==true)
			{
				isincreasingthandecreasing=1;
				isdecreasingbool=false;
			}
			isincreasingthandecreasing++;
		}
		else
		{
			isdecreasing++;
			isincreasing=1;
			isdecreasingbool=true;
			isincreasingthandecreasing++;
		}	
		maxinc=max(maxinc,isincreasing);
		maxdec=max(maxdec,isdecreasing);	
		maxid=max(maxid,isincreasingthandecreasing);
	}

	int allmax=max(maxinc,maxdec);
	allmax=max(allmax,maxid);

	cout<<allmax<<endl;
}
return 0;

}

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.