Alright im trying to create a program that allows the user to input numbers into an array and then will take the average of all the numbers within the array but im getting very strange results
any help is much appreciated
#include <stdio.h>
#include <stdlib.h>
#define SIZE 9
int main(void)
{
int sum ;
int average;
int num;
int a[SIZE];
int i;
printf(" Input Numbers (enter -1 to end):\n");
scanf( "%d", a[SIZE]);
while( num != -1) {
for ( i = 0; i > 0; ++i)
sum += a[i];
average = sum/i;
printf(" Input Numbers (enter -1 to end):\n");
}
printf("average = %d\n", average);
system("PAUSE");
return 0;
}