I have to create the programm which calculate sinus by using the theory of Taylor series.
I have already something done but is probably wrong...
There it is:
*****************************************
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

const PI = 3.14;
double tolerance = 0.00001;
double y = 0.0;
double f = 1.0; //factorial
int i = 0;
double oldy;
int x;
double pom,co;

void main(void)
{
printf("Type the angle's value");
scanf("%d",&x);

do
{
oldy = y;
y = y + (((pow(-1,i))* (pow(x*PI/180,(2*i+1))))/f);
f = (2*i + 2)*(2*i +3)*f;
i = i + 1;
pom = abs(y - oldy);
}
while (pom > tolerance);
printf("a%d",y);
****************************************
I don't know what to do with this...
Thanks for help....