C examples for stdlib.h:labs
function
<cstdlib> <stdlib.h>
Returns the absolute value of parameter n (|n| ). This is the long int version of abs.
long int labs (long int n);
Parameter | Description |
---|---|
n | Integral value. |
The absolute value of n.
#include <stdio.h> #include <stdlib.h> int main ()/* w w w . j a v a2s . c o m*/ { long int n,m; n=labs(65537L); m=labs(-100000L); printf ("n=%ld\n",n); printf ("m=%ld\n",m); return 0; }