In this program user ask to compute Sine (trigonometric function) Series. The Variable of float or integer type declared that will be use to contain the value. User asks to enter the value and then the computation of PI function described. Here term variable used for temporary value container as in the program this variable contain the x1 and then swapped for Sine. For loop statement also been used for varying the condition. Then using compatible condition the output is displayed.
The trigonometric Symbol Sine Series to be computed through a C program.
- Declare Value of PI and ACC.
- Used Computation algorithm.
- Using Loop Statement.
- Display result On the Screen.
Here is source code of the C program to compute the Sine Series. The C program is successfully compiled. The program output is also shown below.
#define ACC 0.000001
#define PI 3.14
printf("Enter the X value : ");
term = (x2*(-term))/(i*(i-1));
sine = sine+term;
Enter the X value : 100