abs
Integer absolute value function
Description
The abs function computes the absolute value of the integerj
, denoted by Example 1
#include <stdio.h> #include <stdlib.h> int main() { int a = -127; printf("|a| = %d\n", abs(a)); return 0; }
Output:|a| = 127
Last Modified: 23 Feb 12 @ 08:59 Page Rendered: 2022-03-14 15:47:05