Hi, I have the following exercise:

"Write a C language program that reads a sequence of positive numbers from the keyboard

and for each number, print the progressive sum. The program ends when you enter a number less than or equal to zero."

Here's what I made but It seems to skip the for cycles. Help?

Output:

**somma_numeri_positivi.c:23:21: ****warning: ****format specifies type 'int *' but the**

** argument has type 'int (*)[i][j]' [-Wformat]**

if ( scanf("%d",&numbers) == 0 )

** ~~ ^~~~~~~**

**somma_numeri_positivi.c:38:5: ****warning: ****expression result unused [-Wunused-value]**

getc;

** ^~~~**

2 warnings generated.

Input a sequence of 0 numbers

3 <-- My input

[Program ended]

Code:

int main(void)
{
int i;
int j;
int n;
int sum;
int numbers[i][j];
printf("input a sequence of %d numbers\n", n);
for (j=0; j<n; j++)
{
printf("element %d: ", i);
scanf("%d", &numbers[i][j]);
}
if ( scanf("%d",&numbers) == 0 )
{
for(i=0;i<n;i++)
{
sum = 0;
for(j=0;j<n;j++)
{
sum = sum + numbers[i][j];
}
printf("sum: %d\t", sum);
}
}
printf("Program end");
getc;
}