In this C++ tutorial, you will learn how to find the arc sine of a value using asin() function of cmath, with syntax and examples.

C++ asin()

C++ asin() returns inverse sine a number in radians.


The syntax of C++ asin() is



xA double, float, or long double number. The allowed range of x is [-1, 1]


The return value depends on the type of value passed for parameter x. The return value of asin(x) is

  • double if x is double.
  • float if x is float.
  • long double if x is long double.

The synopsis of asin() function is

double asin(double x);
float asin(float x);
long double asin(long double x);
double asin(T x); // for integral type argument values

asin() is a function of cmath library. Include cmath library in the program, if using asin().



In this example, we read x value from the user and find the inverse sine of this value using asin() function.

C++ Program

#include <iostream>
using namespace std;

int main() {
    double x;
    cout << "Enter a value : ";
    cin >> x;
    double result = asin(x);
    cout << "asin(" << x << ") : " << result << " radians" << endl;


Enter a value : 1
asin(1) : 1.5708 radians
Program ended with exit code: 0
Enter a value : 0.5
asin(0.5) : 0.523599 radians
Program ended with exit code: 0


In this C++ Tutorial, we learned the syntax of C++ asin(), and how to use this function to find the inverse sine of a given value, with the help of examples.