what is wrong in this code ??? it shows wrong answer :((((

#include<stdio.h>
#include
#include
#include
#include
//#include
using namespace std;
int main()

{

int test_cases,length,len;
int p1,p2,count;
for(scanf("%d",&test_cases);test_cases--;){
count=0;
scanf("%d",&length);
int horse[length];
int len=length-1;
for(int i=0;i<length;i++)scanf("%d",&horse[i]);
sort(horse,horse+length);

int min1;
//while(p1>-1){
  for(int i=0;i<len;i++)
  for(int j=0;j<len;j++)
  {if(j==i)
  continue;
          min1=min(abs(horse[i],horse[j]));
  }   
  cout<<min1;        
  }           
  cin>>p2;

}

@sugeerth1: You can not discuss strategy, suggestions or tips in the comments during a live contest. This may lead to disqualification.

i am not getting output without writting conio.h. iam using dev c++ compiler .what may be the reason

//