hi,
code is mostly correct.
It seems the problem is in this part :
for (m=0; m<N; m++){
sum = sum + array[m];
sum = sum[j]
}
for (x=0; x<T; x++) printf ("%d\n", sum[j]);
first of all i do not see j defined anywhere.
suggestion ::
#include<stdio.h>
int main()
{
int T, N, test, array[20], sum[20];
int tempSum;
do
{
printf ("How Many Test Case \n");
scanf ("%d", &T);
if (T<1 || T>100){
printf ("Please Input Integer 0<T<100 \n");
}
} while (T<1 || T>100);
for (test=0; test<T ; test++)
{
printf ("How many Integers to sum? \n");
scanf ("%d", &N);
int i=0;
while(i<N)
scanf("%d",&array[i++]);
int m=0, tempSum=0;
for (m=0; m<N; m++)
{
tempSum = tempSum + array[m];
}
sum[test] = tempSum;
}
for (x=0; x<T; x++)
printf ("%d\n", sum[x]);
return 0;
}
did not test this by executing so please test yourself.
hope it works !!