# C program to find sin(x), when x is given in degrees

Saurabh | Apr 07, 2010 | Comments 3

To find the value of sin(x) when x is given in degrees we must know 2 things :

1. The library function sin(x) takes the argument in radians, so we have to 1st convert the degrees into radians.

2. The constant M_PI, which is included in “math.h” and has the value of the constant pi.

On knowing these things, the program becomes quite simple :

The exe file can be downloaded from here : SINE

#include "stdio.h" #include "math.h" int main() { double result,degrees,radians; printf("Enter the no. of degrees : "); scanf("%lf",°rees); radians = degrees*(M_PI/180); result = sin(radians); printf("%lf\n",radians); printf("The sin() of %lf is %lf\n", degrees, result); return 0; }

**About the Author**: Software Engineer - Search & Recommendation at Rovi

Thanks for the source code for the program. We always appriciate the support provided by you.

Thank u sir ..!

Thanks for the source code.It became very helpful to me.