fabs: returns the absolute value of num : fabs « math.h « C / ANSI-C






fabs: returns the absolute value of num


    

//Declaration: float fabsf(float num); 
               double fabs(double num); 
               long double fabsl(long double num);  
 

  

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

  int main(void)
  {
    printf("%1.1f %1.1f", fabs(1.0), fabs(-1.0));

    return 0;
  }

         
/*
1.0 1.0*/ 

           
       








Related examples in the same category