C Language: abs function
(Absolute Value of Integer)
In the C Programming Language, the abs function returns the absolute value of an integer.
Syntax
The syntax for the abs function in the C Language is:
int abs(int x);
Parameters or Arguments
- x
- A value to convert to an absolute value.
Returns
The abs function returns the absolute value of an integer represented by x.
Required Header
In the C Language, the required header for the abs function is:
#include <stdlib.h>
Applies To
In the C Language, the abs function can be used in the following versions:
- ANSI/ISO 9899-1990
Similar Functions
Other C functions that are similar to the abs function:
Advertisements