
Implement a function that says whether a + b would leave the range of an int, and says it without ever computing a + b.
add_overflows(2, 3)Expected result
0For your own tracking. Tests grade your code.
add_overflows(INT_MAX, 1)Expected result
1add_overflows(INT_MAX, INT_MIN)Expected result
0add_overflows(INT_MIN, -1)Expected result
1add_overflows(INT_MIN, 0)Expected result
0Expected files
add_overflows.cAllowed functions
None. Write every helper yourself.
Allowed headers

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement a function that says whether a + b would leave the range of an int, and says it without ever computing a + b.
add_overflows(2, 3)Expected result
0For your own tracking. Tests grade your code.
add_overflows(INT_MAX, 1)Expected result
1add_overflows(INT_MAX, INT_MIN)Expected result
0add_overflows(INT_MIN, -1)Expected result
1add_overflows(INT_MIN, 0)Expected result
0Expected files
add_overflows.cAllowed functions
None. Write every helper yourself.
Allowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.