llabs - C stdlib.h

C examples for stdlib.h:llabs

Type function

From

<cstdlib>
<stdlib.h>

Description

Returns the absolute value of parameter n (|n|). This is the long long int version of abs.

Prototype

long long int llabs (long long int n);

Description

Parameters

Parameter Description
n Integral value.

Return Value

The absolute value of n.

Demo Code


#include <stdio.h>
#include <stdlib.h>

int main ()//from  w  w w. ja  va2 s  .  c  om
{
  long long int n,m;

  n=llabs(31991234LL);

  m=llabs(-109901234LL);

  printf ("n=%lld\n",n);

  printf ("m=%lld\n",m);

  return 0;
}

Related Tutorials