Im suppose to write a code using one-dimension array, of size 100 only, and output the array on screen. The user should imput the value n from the keyboard, and then calculate, and display the sum between -n to n ONLY.
I started it out, and its giving me a weird output of odd numbers. Im completely lost :S. Where am I going wrong?
#define SIZE 100
int integer[SIZE], n, j, sum, sum1;
printf("Enter an integer: ");
while (scanf("%s", &integar[n]) !=EOF)
if(integars[n] == -1)
printf("The sum is %d\n", sum);