Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

//main function main() { //variable declarations int score, sum = 0, count = 0; double average; printf("Enter a test score (-1 to quit):"); scanf("%i", &score); while (score != -1) { count = count + 1; sum = sum + score; printf("Enter a test score (-1 to quit):"); scanf("%i", &score); } average = (double) sum / count; printf("\nThe sum of the scores is: %i\n", sum); printf("You entered %i scores. \n", count); printf("The average score is: %.2lf\n", average); system("Pause"); } //end main

OpenStudy (anonymous):

I need help to write a code for the computer to determine the lowest and highest test score !? please help

OpenStudy (rsmith6559):

If this is an addition to the code above, just declare a variable lowest to a high value, like a million, and a variable highest set to zero and compare and (maybe) replace as you go through the scores.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!