sin() in C
Last Updated :
26 Sep, 2023
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
Return Value
- Returns the sine of the given radian angle which ranges between +1 to -1.
Example of sin()
C
#include <math.h>
#include <stdio.h>
int main()
{
double angle1 = 3.1415926;
double angle2 = 10;
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
Share your thoughts in the comments
Please Login to comment...