Table of Content

Labs (x) >> Absolute Value of Long Number



Header File :

  1. Stdlib.h
  2. Math.h

Syntax :

long labs( long num );
No of Parameters : 1
Parameter : Long
Return Type : Long

What it Does ?

  • The function labs() returns the absolute value of long.
  • Labs calculates the absolute value of a long number.

Live Example :

#include < stdio.h>
#include < math.h>
int main(void)
{
long result;
long x = -12345678L;

result= labs(x);
printf("number: %ld abs value: %ldn", x, result);

return 0;
}