abs
Integer absolute value function
Description
The abs function computes the absolute value of the integerj
, denoted by
and defined through:
Example 1
#include <stdio.h> #include <stdlib.h> int main() { int a = -127; printf("|a| = %d\n", abs(a)); return 0; }
Output:|a| = 127