#include <stdio.h>
int max(int x, int y);
int min(int x, int y);
int main()
{
int grade, total, counter, avg;
total = 0;
counter = 0;
printf("Enter grades: (-1 to end list)\n");
do
{
scanf("%d", &grade);
if(grade != -1)
{
total = total + grade;
counter = counter + 1;
avg = (float)total / counter;
}
}
while (grade != -1);
{
printf("max = %d\n", max);
printf("min = %d\n", min);
printf("average = %0.2f\n", (float)total/counter);
}
}
int max(int x, int y)
{
int biggest = x;
if (y > biggest)
biggest = y;
return biggest;
}
int min(int x, int y)
{
int smallest = x;
if (y < smallest)
smallest = y;
return smallest;
}
i need help finding the maximum and minimum values inputed by the user. i keep getting values such as 67808 and 67880 as my maximum and minimum values when those are not values inserted by the user. somebody help please!