Get absolute value of long integer parameter: how to use labs : Absolute Value « Math « C / ANSI-C






Get absolute value of long integer parameter: how to use labs


#include <stdio.h>
#include <math.h>

int main ()
{
  int n, m;
  n = labs( 645537 );
  m = labs( -100010 );
  printf (" n = %d\n", n);
  printf (" m = %d\n", m);
  return 0;
}



           
       








Related examples in the same category

1.How to get absolute value for float
2.Return absolute value of floating-point: fabs Return absolute value of floating-point: fabs
3.Return absolute value of integer parameter: how to use abs