Open In App

sin() in C

Last Updated : 26 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The sin() function in C is a standard library function to find the sine value of the radian angle. It is used to evaluate the trigonometric sine function of an angle. It takes the radian angle as input and returns the sin of that angle. It is defined inside <math.h> header file.

Syntax of sin()

The syntax of sin() function in C is:

double sin(double angle);

Parameters

  • angle: Angle in radians.

Return Value

  • Returns the sine of the given radian angle which ranges between +1 to -1.

Example of sin()

C




// C program to illustrate the sin() function
#include <math.h>
#include <stdio.h>
  
int main()
{
    double angle1 = 3.1415926;
    double angle2 = 10;
  
    // printing the sine value of angle1 and angle2
    printf("sin(3.14) = %.2lf\n", sin(angle1));
    printf("sin(10) = %.2lf", sin(angle2));
  
    return 0;
}


Output

sin(3.14) = 0.00
sin(10) = -0.54









Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads