Function name : labs
Header file : <math.h>
Function prototype : long labs(long n);
Function : Get the absolute value of long integer
Parameters : long n long integer type to be operated on
Return value : Returns the absolute value of a long integer
Program example : Find the absolute value of long integer x and output the result
#include<stdio.h>#include<math.h>intmain(void){longresult;longx=-12345678L;result=labs(x);printf(number:%ldabsvalue:%ldn,x,result); return0;}
Running results:
number:-12345678absvalue:12345678