Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a while loop using a taylor series (not the taylor series function) to fin

ID: 2992209 • Letter: W

Question

Write a while loop using a taylor series (not the taylor series function) to find the value of sin(1.556*10^-3) to four significant figures. (I think es = (0.5*10.^(2-n)) needs to be used.

Explanation / Answer

#include #include #include double exponential (double); int factorial (int); int main (void) { int x; double sum; printf( "enter value of x: "); scanf( "%i", &x); while( e >= 0.000001 ) { sum += exponential(x); } printf( "Taylor Series of e^x is approximately = %.6f ", sum); system("PAUSE"); return 0; } double exponential(double x) { double e; /* e^x */ e = pow(x, n) / factorial(n); return e; } int factorial (int n) { int factorial=1; while(n > 1) { factorial *= n; n--; } return factorial; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote