when i scanned 't' value is 1 but by the end of the loop its value is changed to 2 without any incrementation
#include <stdio.h>
int main()
{
int i,t,n,a[]={},b[]={},k=0,p;
printf("enter the number ");
scanf("%d",&t);
for(p=0;p<t;p++)
{
scanf("%d",&n);
for(i=0;i<n-1;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n-2;i++)
{
// printf("\nhello");
if((a[i+1]-a[i])!=1)
b[k]=a[i];
k++;
}
printf("\n%d",t);
}
return 0;
}
output:
enter the number 1
4
1
2
4
2