Issue regarding calculation of sinx using Taylor series : I am trying to calculate the value of sin(x) without using the predefined function.
Instead I am trying to calculate it using Taylor series.

The issue is that the program produces correct values for small values of x(lesser than 10 to be precise).

As the value of x increases I start to get wrong values of sin(x) [ for example greater than 100.]

I have included 1000 iterations of the series but still the program produces wrong answers for large values of x.

	float e,x,p=2;
	int a;
	float sum1;

	cout<<"enter the value x for sinx"<<endl;
	cin>>x;
	e=x;
	sum1=x;

	for(a=1;a<1000;a++)
	{	
	[enter image description here][1]	x=x*(e/p)*(e/(p+1))*(-1);   //MULTIPLYING PREVIOUS TERM to -1*e/p * e/p+1 to get the next term.
		sum1=sum1+x;
		p=p+2;
	}
	cout<<sum1<<endl;

	return 0;


AND FOR LARGE VALUES OF X( ie X>100) I GET THE NaN output WHICH MEANS NOT A NUMBER.
		
		`

HERE IS A SAMPLE OUTPUT.
  [1]:  https://i.stack.imgur.com/4Smeo.png

PLEASE HELP!! , I'm curious to know what went wrong.