logo CodeStepByStep logo

bound_range

Language/Type: C Math return
Author: Allison Obourn (on 2020/09/14)

Write a function called bound_range that takes an integer representing an age as a parameter and returns an integer representing a valid age. A valid age is between 0 and 110. If a negative number is passed in it should be replaced with 0 and a number greater than 110 should be replaced with 110.

Function: Write a C function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.