Question
Write a C program Q1. write a double function term(double x, int n) that compute x*x....*x/(n!), that is compute x*x....*x/(1*2*3*....*n) where the numerator multiplies together
Write a C program
Q1.
write a double function term(double x, int n) that compute x*x....*x/(n!), that is compute x*x....*x/(1*2*3*....*n) where the numerator multiplies together n copies of x. the code should work for all non-negative values of n, and for all values of x provided that underflow or overflow does not occur in your computation. remember that 0! =1 and that x^0=1.
write a double function series(double x, int m) that computes the sum of m calls to term, where the i"th call is term(x,i)
fianl, test code by running it with integer x vaules ranging from -5 to 5 inclusive (11 values). printout the values as a table. for each value print out x, term(x,0),term(x,1),term(x,2) and series(x,10). print out each value in a column of width 10 with 4 decimal places and one space between between each number.
code should be properly formatted be written in ANSI C
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started