Function name : fabs
Header file : <math.h>
Function prototype : double fabs(double x);
Function : Find the absolute value of a floating point number
Parameters : double x is the double precision value to be operated on
Return value : Returns the absolute value of the floating point number
Program example : Find the absolute value of a floating point number and output the result
#include<stdio.h>#include<math.h>intmain(void){floatnumber=-1234.0;printf(number:%fabsolutevalue:%fn,number,fabs(number));return0;}
Running results:
number:-1234.000000absolutevalue:1234.000000