labs
Return the absolute value of a long integer
Description
The labs function returns the absolute value of the long integerj
, denoted by
and defined through:
Example 1
#include <stdio.h> #include <stdlib.h> int main() { long int a = -231564565; printf("|a| = %ld\n", labs(a)); return 0; }
Output:|a| = 231564565