1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <stdio.h> 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("%d",&n); printf("Please enter %d numbers\n",n); scanf("%d",&num); max = min = num; while(1) { if(num>max) max=num; if(num < min) min=num; sum=sum+num; squaresum=squaresum + (num*num); count++; if(count==n) break; scanf("%d",&num); } average = 1.0*sum/n; printf("Your average is %.2f\n",average); printf("The sum of your squares is %d\n",squaresum); printf("Your maximum number is %d\n",max); printf("Your minimum number is %d\n",min); return 0; } |

**OUTPUT:**

1 2 3 4 5 6 7 8 9 10 11 12 | Please enter the number of numbers you wish to evaluate 5 Please enter 5 numbers 2 2 1 5 4 Your average is 2.80 The sum of your squares is 50 Your maximum number is 5 Your minimum number is 1 |