Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming not C++ The no root of a real number X is computed using the iterative formula: - (n - 1)xk + X Xk+1

C programming not C++

image text in transcribed
The no root of a real number X is computed using the iterative formula: - (n - 1)xk + X Xk+1 = n .n-1 XK The iterations will continue until the difference between two (2) successive values of the root is less that a small value &. Assume & a constant value equal to 105. Assume also that the initial value xo = X, and that Xx is the old value and Xx+ 1 the updated or new value of x. Write a complete C program that prompts the user to enter the values of X and n, then computes the nth root of X using the above approach. The above formula has to be implemented as a function with two inputs X and n. The code should check that when n is even, the value of X has to be positive, and for that purpose you need another small function that returns TRUE (1) if n is even and another function to check if X is less than 0. Sample program sample run: Enter n: 4 Enter X: -20 Enter n: 3 Wrong Input. Repeat again ! Enter X: 15 Enter n: 4 ZTZ99p Z = (80 ST) jo zoo4 47(E) Enter X: 20 (4) th root of (20.00) = 2.114743

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions