Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C program with a loop that asks user to enter a series of integers in th

ID: 3620740 • Letter: W

Question

Write a C program with a loop that asks user to enter a series of integers in the range of [-100 100]. If user enters a number out of that range, your program shouldn’t consider it, and should ask for a new number. The user should enter 0 to stop the loop. When the loop stops, we want your program to display the largest TWO numbers entered in the range of [-100 100], the smallest TWO numbers entered in the range of [-100 100], the average of negative numbers entered in the range of [-100 100], and the average of positive numbers entered in the range of [-100 100].
For example if user enters -2, then 3, then -4, then -200, then 5, then -3, then 120, then 0
Your program should stop and print:
Two largest numbers are : 5 3
Two smallest numbers are : -4 -3
Average of negative values is -3
Average of positive values is 4

Explanation / Answer

-start a loop -ask for input -check the input using if-else (if 0 stop, if x>100 or x
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote