could anyone tell me why I am getting this output?
for just one case the count value should not be increasing, but I can’t help myself where I am getting wrong, please correct me…
following is my code:
#include <stdio.h>
int main(void) {
int t,n,a[n];
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(int j=0;j<n;j++)
{
scanf("%d",&a[j]);
}
int count = 1;
for(int i=0;i<=n;i++)
{
if(a[i+1]<=a[i])
count++;
}
printf("%d\n",count);
}
// your code goes here
return 0;
}