Why isn't INT_MIN and INT_MAX returning the numbers I want them to? What exactly am I doing wrong?
Code:
#include <stdio.h>
#include <limits.h>
main()
{
int count=0;
int sum=0;
int input=0;
printf("Enter a number\n");
while (scanf("%d",&input)!=EOF)
{
sum+=input;
count++;
if(count==20)
break;
printf("Enter another number\n");
}
printf("The total of all entered numbers is %d\n",sum);
printf("The number of entries are %d\n",count);
printf("The minimum value entered is %d\n",INT_MIN);
printf("The maximum value entered is %d\n",INT_MAX);
printf("The average of all the numbers is");
printf(" %d with a remainder of %d\n\n",sum/count,sum%count);
}