Question: 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++

C programming not C++ The no root of a real number X

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!