So I\'m coding in C, and I need to come up with code that will take n numbers from the user, and find their minimum, maximum, average, and sum of squares for for their values. S
Enter the first num
outside the loop and assign that to max
min
scanf("%d",&num);
max = min = num;
Change your while loop to infinite loop
while(1) {...}
and now check for the condition that whether your counter count
is equal to n
is or not to break
out from the infinite loop
if(count == n)
break;
Full code after modification:
#include
int main()
{
float average;
int i, n, count=0, sum=0, squaresum=0, num, min, max;
printf("Please enter the number of numbers you wish to evaluate\n");
scanf_s("%d",&n);
printf("Please enter %d numbers\n",n);
scanf_s("%d",&num);
max = min = num;
while(1)
{
if(num>max)
max=num;
if(num