#include <stdlib.h>
int abs(int n);
The abs() function returns the absolute value of an argument n.
For the integer version of abs(), the minimum allowable integer is INT_MIN+1. (INT_MIN is a macro that is defined in the limits.h header file.) For example, with the Metal C compiler, INT_MIN+1 is -2147483647.
The returned value is the absolute value, if the absolute value is possible to represent.
Otherwise the input value is returned.