#include <stdio.h>
#include <math.h>
// double acos(double x); // returns the arc cosine in radians.
int main() {
double value = 0.5; // Input value for acos (must be in the range [-1, 1])
double result;
// Compute the arccosine
result = acos(value);
// Print the result in radians
printf("The arccosine of %.2f is %.2f radians.\n", value, result);
// Convert radians to degrees
double result_in_degrees = result * (180.0 / M_PI);
printf("The arccosine of %.2f is %.2f degrees.\n", value, result_in_degrees);
return 0;
}
/*
run:
The arccosine of 0.50 is 1.05 radians.
The arccosine of 0.50 is 60.00 degrees.
*/