Average, max, and min program in C

前端 未结 8 688
梦毁少年i
梦毁少年i 2021-01-21 02:55

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

8条回答
  •  滥情空心
    2021-01-21 03:05

    The way your code is currently written, min has to start out at a high value (not 0), or the code won't work. The best value to choose is the maximum possible value for an int.

    You should also consider whether or not you want to reset these variable each time through the loop.

提交回复
热议问题