My prof. wantedme to write a C program that calculates the sine of x with a truncation error less than .000001. He also says that for each iteration of the series I should print out the iteration number, the calculated value, truncation error, and the C math librar calculated sine or x. I'm not sure whether I need the printf and the scanf that prompts the user to input a number, or what I should set myint equal to. If you can help in any way, I would greatly appreciate it. Thank you,
Kristina

#include <stdio.h>
#include <math.h>
main()
{
double iter, flipflop, num, fact, k, sinx, mynum;
num=1;
iter=1;
fact=1;
for(k=2; k<=iter; k++);
{
fact=fact*k;
}
do
{
pow(num,iter);
sinx=sinx + num/fact*flipflop;
printf("truncation error %f\n",sinx);
sin(num);
~~> printf("please enter a number\n");
~~>scanf("%d " , mynum);
printf("iteration number %f\n", iter);
printf("math library calculation %f\n",sin(num));
printf("the calculated value is %f\n",sinx);
iter=iter+2;
flipflop=-1;
}
while(num/fact <= .000001);
}