You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
#include<math.h>
void main()
{
int i,dn=1,n,p=1;
float x,nx,term,sum=0;
clrscr();
cout<<"Enter the value of x in degree :"<<endl;
cin>>x;
cout<<"Enter the value of n: "<<endl;
cin>>n;\
x=(x*3.1512)/180;
nx=x;
for(i=1;i<=n;i++)
{
term=nx/dn;
sum=sum+term;
nx=nx*(-x)*(x);
p=p+2;
dn=dn*(p-1)*p;
}
cout<<"The value of sinx :"<<sum;
getch();
}

You might also like