i am trying to write a program that will prompt the user to enter test scores terminated by a negative number. and then find the min max and average of the scores inputted. i have gotten everything to work except the average. the assignment says i can only use variables of type "int" so my question is how to print the average to 2 decimal places using only int and not floats. this is what i have so far
main()
{
int number, min, max, count, sum;
printf("Enter test scores; enter any negative value to end list\n");
scanf("%d", &number);
min = number;
max = number;
for (count=1; count<=10; count++)
{
if (number>=0)
{
scanf("%d", &number);
if (number < min)
min = number;
else if (number > max)
max = number;
sum = sum + number;
count=count+1;
scanf("%d", &number);
}
}
printf("Lowest Score = %d\n", min);
printf("Highest Score = %d\n", max);
printf("Average Score = %0.2f\n",(float)sum/count);
}