Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

fabs() c++

#include <iostream>
#include <cmath>       /* fabs */
using namespace std;
int main ()
{
  cout<<"The absolute value of 3.1416 is "<< fabs (3.1416) <<endl;
 cout<< "The absolute value of -10.6 is "<< fabs (-10.6) <<endl;
 /*
 	The absolute value of 3.1416 is 3.1416
	The absolute value of -10.6 is 10.6
*/
  return 0;
}
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+8 =