showing wrong answer for second largest no

#include <stdio.h>
#include <stdlib.h>

int main()
{long int n1,n2,n3,a,b,c,sl,t;

scanf("%d",&t);
while(t–)
{
scanf("%ld",&n1);
scanf("%ld",&n2);
scanf("%ld",&n3);
a=n1;
b=n2;
c=n3;
sl=a;
if(sl>b)
{
sl=b;
if(sl>c)
{
sl=c;
printf("%ld",sl);
}
else
printf("%ld",sl);
}
else
{
sl=b;
if(sl>c)
{
sl=c;
printf("%ld",sl);
}
else
printf("%ld",sl);
}

}

return 0;
}

this runs perfectly on codeblocks and shows desired output as for this problem.then where i am missing something?

I think You are not printing “\n” after every output or can you send me the question link

//