*Return the absolute value of an integer*

#include <stdlib.h> int abs( intj);

*j*- The number you want the absolute value of.

`libc`

Use the ` -l c` option to

The *abs()* function returns the absolute value of the integer argument *j*.
The behavior is undefined if the result can't be represented as an
`int`.
Note that the absolute value of the most negative number can't be represented
in two's complement.

The absolute value of its argument.

#include <stdio.h> #include <stdlib.h> int main( void ) { printf( "%d %d %d\n", abs (-5), abs (0), abs (5)); return EXIT_SUCCESS; }

produces the following output:

5 0 5

Safety: | |
---|---|

Cancellation point | No |

Interrupt handler | Yes |

Signal handler | Yes |

Thread | Yes |