Solution to CHEFSUM.It is showing W.A.Why?

#include<stdio.h>
int main()
{
int T,i;
scanf("%d",&T);
while(T!=0)
{
int n;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++)
scanf("%d",&A[i]);
int k=A[0];
int j=0;
for(i=0;i<n;i++)
{
if(A[i]<k)
{
k=A[i];
j=i;
}
}
printf("%d",j+1);
T–;
}
return 0;
}

printf("%d",j+1);

Print each answer on a new line. Use newline character.

1 Like

Adding to it

printf("%d\n",j+1); <—like this

2 Likes
//