I am trying to write C code for sin(x) using the first 5 terms of the taylor series. I am new to programming and am not allowed to use loops. I don't have much yet, but what I have so far is:
I am not really sure where to go from here. I am a little confused about how to implement the taylor series to calculate sin(x). Any help would be appreciated, thanks.
Code:
/* solution to Taylor Series approximation of sin(x) */
#include <stdio.h>
#define PI 3.1416f
int main ()
{
float x_deg;
float x;
float sinx;
/*enter the angle "x_deg in degrees"*/
printf ("Enter x_deg:");
scanf ("%f, %x_deg);
x=x_deg*PI/180;
Comment