
Repair safe_div so it writes a / b through out when the division is legal and reports failure otherwise.
int out = 777; safe_div(84, 2, &out)ret=0 out=42int out = 777; safe_div(-7, 2, &out)ret=0 out=-3int out = 777; safe_div(10, 0, &out)ret=-1 out=777int out = 777; safe_div(INT_MIN, 1, &out)ret=0 out=-2147483648divide_guard.c<limits.h>defines INT_MIN and INT_MAX
Run the tests to grade your code
Repair safe_div so it writes a / b through out when the division is legal and reports failure otherwise.
int out = 777; safe_div(84, 2, &out)ret=0 out=42int out = 777; safe_div(-7, 2, &out)ret=0 out=-3int out = 777; safe_div(10, 0, &out)ret=-1 out=777int out = 777; safe_div(INT_MIN, 1, &out)ret=0 out=-2147483648divide_guard.c<limits.h>defines INT_MIN and INT_MAX
Run the tests to grade your code
Memory will appear here