How to calculate PI value with asin() function in C++

1 Answer

0 votes
#include <iostream>
#include <cmath>

int main()
{
    double pi = 2 * asin(1.0); 
 
    std::cout << "pi = " << pi << "\n";
}

 
/*
run:
 
pi = 3.14159

*/

 



answered Oct 4, 2024 by avibootz

Related questions

1 answer 101 views
1 answer 116 views
2 answers 471 views
2 answers 882 views
1 answer 241 views
2 answers 288 views
2 answers 295 views
...