Program to find sinx=x-x33!+x55!+x77! Upto n term.
#include<stdio.h>
#include<math.h>
main()
{
int n,count=1,i,j,sin=1,ang;
float x,sum=0,term,nr;
double dr;
clrscr();
printf("\nEnter the angle:\n");
scanf("%d",&ang);
printf("\nEnter the number of terms\n");
scanf("%d",&n);
x=ang*3.14/180;
for(i=0;i<n;i++)
{
nr=pow(x,count);
dr=1;
for(j=1;j<=count;j++)
dr=dr*j;
term=sin* nr/dr;
sum=sum+term;
count=count+2;
sin=-1*sin;
}
printf("\nSin(%d)= %f",ang,sum);
getch();
}