Create an inline function that clamps (saturates) a sensor reading between a minimum and maximum value.
The inline function must:
value
minVal
maxVal
minVal <= maxVal
value < minVal
value > maxVal
No overflow handling is required beyond standard int behavior.
int
In main():
main()
Example 1
Input:
120 0 100
Output:
100
Example 2
-5 0 50
0
Example 3
42 0 50
42
Constraints:
Test Cases
Test Results
Input
Expected Output