#include<math.h>
void main()
{
int i = 2, n, s = 1, x, pwr = 1, dr;
float nr = 1, x1, sum;
clrscr();
printf(“nnt ENTER THE ANGLE…: “);
scanf(“%d”, &x);
x1 = 3.142 * (x / 180.0);
sum = x1;
printf(“nt ENTER THE NUMBER OF TERMS…: “);
scanf(“%d”, &n);
while(i <= n)
{
pwr = pwr + 2;
dr = dr * pwr * (pwr – 1);
sum = sum + (nr / dr) * s;
s = s * (-1);
nr = nr * x1 * x1;
i+= 2;
}
printf(“nt THE SUM OF THE SINE SERIES IS..: %0.3f”,sum);
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program To find the sum of the cos series
- C program to find the sum of cos(x) series
- C program to read N integers (zero, +ve and -ve) into an array A and to a) Find the sum of negative numbers b) Find the sum of positive numbers and c) Find the average of all input numbers Output the various results computed with proper headings
- C program to read N integers and store them in an array A, and so find the sum of all these elements using pointer. Output the given array and and the computed sum with suitable heading
- C program to read a matrix A (MxN) and to find the following using functions a) Sum of the elements of each row b) Sum of the elements of each column c) Find the sum of all the elements of the matrix Output the computed results with suitable headings
