1
2 * C++ Program to Obtain Inverse of a Trigonometric Ratio
3 */
4#include <iostream>
5#include <cmath>
6#include <iomanip>
7
8int main()
9{
10 double value, result;
11 int choice;
12
13 std::cout << "Enter a choice " << std::endl;
14 std::cout << "1. Inverse Sine" << std::endl;
15 std::cout << "2. Inverse Cosine" << std::endl;
16 std::cout << "3. Inverse Tangent" << std::endl;
17 std::cin >> choice;
18 switch (choice) {
19 case 1:
20 std::cout << "Enter a value ";
21 std::cin >> value;
22 std::cout << "asin(val) = " << std::setprecision(3)
23 << asin(value) << std::endl;
24 break;
25 case 2:
26 std::cout << "Enter a value ";
27 std::cin >> value;
28 std::cout << "acos(val) = " << std::setprecision(3)
29 << acos(value) << std::endl;
30 break;
31 case 3:
32 std::cout << "Enter a value ";
33 std::cin >> value;
34 std::cout << "atan(val) = " << std::setprecision(3)
35 << atan(value) << std::endl;
36 break;
37 }
38 return 0;
39}