#include#include using namespace std; int main() { double x = 0.5; double result = atan(x); cout << "arctan(" << x << ") = " << result << " radians" << endl; return 0; }
arctan(0.5) = 0.463648 radians
#include#include using namespace std; int main() { double x = 0.5; double result = atan(x) * 180 / M_PI; cout << "arctan(" << x << ") = " << result << " degrees" << endl; return 0; }
arctan(0.5) = 26.5651 degreesThe std atan function is part of the cmath library which is part of the C++ standard library.