8. Check Range

Given integers val, min, and max. Write a function bool IsInRange(int val, int min, int max) that returns true if val falls within the range [min, max] inclusive.
Example 1
Input: val = 0, min = 1, max = 5
Output: false
Explanation: 0 is less than the lower bound of the range
Example 2
Input: val = 3, min = 3, max = 3
Output: true
Explanation: The number equals both bounds of the range
Example 3
Input: val = 5, min = 1, max = 10
Output: true
Explanation: 5 is between 1 and 10, inclusive
easy
JavaScript
Loading...
Line 1, Char 1