C++ Programming Code Examples C++ > Mathematics Code Examples There are two different functions to get the absolute value of an integer There are two different functions to get the absolute value of an integer int abs(int) and of a double value double fabs(double): cout << "The absolute value of -10 is " << abs(-10) << endl; cout << "The absolute value of 12.71 is " << fabs(12.71) << endl; cout << "The absolute value of -88 is " << abs(-88) << endl; cout << "The absolute value of 4 is " << abs(4) << endl; cout << "C++ Programming Language | Happy Codings :)";