So here's my problem:

Write a program that reads a list of integers from thekeyboard and creates the following information:

a. Finds and prints the sum and average of the integers

b. Finds and prints the largest and the smallest integer

c. Prints a Boolean (true or false) if some of them are less than 20

d. Prints a Boolean (true or false) if all of them are between 10 and 90

The input data consist of a list of integers with a sentinel. The program must prompt the user to enter the integers, one by one, and enter the sentinel when the end of the list has been reached (represented by 99999).

Here's my code:

I am getting a "parse error at end of input" message, and I can't figure out why. Any help would be appreciated. ThanksCode:#include <stdio.h> #include <stdlib.h> int main(void) { /*Local Definitions*/ int num; int sum = 0; int larg = 0; int smal = 99998; int less = 0; int tween = 0; int count = 0; long avg; /*Statements*/ printf("Enter numbers with <return> (99999 to stop):"); while (scanf("%d", &num)!= 99999); count++; sum += num; avg = sum / count; { if (num < smal); { smal = num; } if (num > larg); { larg = num; } if (num < 20); { less = 1; } if (10 < num < 90); { tween = 1; } printf("The number of integers is: \t%d", count); printf("The sum of the integers is: \t%d", sum); printf("The average of the integers is: \t%d", avg); printf("The smallest integer is: \t%d", smal); printf("The largest integer is: \t%d", larg); if (less = 1) { printf("At least one number was < 20: True"); } else printf("At least one number was < 20: False"); if (tween = 1) { printf("All numbers were (10 <= n <= 90): True"); } else printf("All numbers were (10 <= n <= 90): False"); system("PAUSE"); return 0; }

melee