C++

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

C++

Post by answerhappygod »

C++
C 1
C 1 (65.71 KiB) Viewed 24 times
Restrictions ● There should be no loops such as for loops, while loops, do-while loops, foreach loops used in this work. Instead use recursion only. Write a recursive function named F that takes a single parameter of type int (named n) to compute the following series. 1 1 1 + 1 f(n) = - - + + 3 8 15 n(n + 2) Test your function by writing a main function and calling F with various values for n. Output should be rounded to 4 decimal places. Here are some sample test cases. F(1) returns 0.3333 F(2) returns 0.4583 F(3) returns 0.525 F(4) returns 0.5667 +
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply