English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C Library Function double sin(double x) Returns the radian angle x sine.
Below is the declaration of the sin() function.
double sin(double x)
x -- A floating-point value representing an angle in radians.
This function returns the sine of x.
The following example demonstrates the usage of the sin() function.
#include <stdio.h> #include <math.h> int main() { double x; double result; x = 2.3; result = sin(x); printf("sin(%.2lf) sine is = %.2lf degree, x, result); x = -2.3; result = sin(x); printf("sin(%.2lf) sine is = %.2lf degree, x, result); x = 0; result = sin(x); printf("sin(%.2lf) sine is = %.2lf degree, x, result); return 0; }
Let's compile and run the above program, which will produce the following result:
sin(2.3The sine of 0) is = 0.75 degrees sin(-2.3The sine of 0) is = -0.75 degrees The sine of 0.00 is = 0.00 degrees