Question: C/C++ PROGRAM. Write a function that accepts two arguments, integer n and real number x, computes the following series, and returns the computed result: 1
C/C++ PROGRAM. Write a function that accepts two arguments, integer n and real number x, computes the following series, and returns the computed result:
1 2(x^2)/1! + 3(x^4)/2! 4(x^6)/3! + ... + [(-1)^n](n+1)(x^2n)!
Notation: 5!=5*4*3*2*1 means 5 factorial The general term is:
- negative one to the power of n
- multiply by (n plus one)
- multiply by x to the power of (2n)
- divided by n factorial
Then write a C program that request two input from the user:
-- an integer number, n -- a real number, x;
call the function passing those two input as arguments, output the result returned by the function.
You may assume that the user will always input n correctly, i.e., an integer 0 or above, and you are NOT required to test that n is a negative number. The following are some sample input combinations and results that you may use to check your answers: (For large n, n>=15, it is acceptable to have an answer different from the correct answer in the least significant digit)
n= 3 10 15 200 x= 2 2 2 2 Ans = -25.666668 0.865679 -0.057734 -0.054947

Write a function that accepts two arguments, integer n and real number x, computes the following series, and returns the computed result 1-2(x^2)/11+ 3(x^4)/21-4(x"6)/31+ + [(-1Pn](n+1)(x^2n)! Notation: 5!-5*4 3*2*1 means 5 factorial The general term is: negative one to the power of n multiply by (n plus one) multiply by x to the power of (2n) divided by n factorial Then write a C program that request two input from the user: an integer number, n - a real number, x; call the function passing those two input as arguments, output the result returned by the function. You may assume that the user will always input n correctly, i.e., an inte ger 0 or above, and you are NOT required to test that n is a negative number The following are some sample input combinations and results that you may use to check your answers: (For large n, n> 15, is acceptable to have an answer different from the correct answer in the least significant digit) 10 15 200 Ans--25.666668 0.865679 -0.057734 -0.054947
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
