Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to use the function acos() in C

1 Answer

0 votes
#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.

*/

 



answered May 16, 2025 by avibootz

Related questions

2 answers 226 views
2 answers 267 views
1 answer 168 views
168 views asked Aug 27, 2016 by avibootz
2 answers 241 views
1 answer 155 views
...