125k views
3 votes
Assume that x is a variable that has been declared as a double and been given a value. Write an expression to compute the quartic root of x. The quartic root of a number is the square root of its square root. EXAMPLES: For example, the quartic root of 16.0 is 2.0 because: the square root of 16.0 is 4.0 and the square root of 4.0 is 2.0. Another example: the quartic root of 81.0 is 3.0 because the square root of 81.0 is 9.0 and the square root of 9.0 is 3.0. Thus, to find the quartic root of a number you take the square root of the number and then take the square root of that. In this exercise you must find the quartic root of x in a single expression-- you must not write any statements. Also, you may only use the sqrt() function-- no other functions. (HINT: you will need to call the sqrt() function twice-- and you will need to pass the return value of one of those calls as argument to the other call. AND REMEMBER: write an expression, not a statement.) SUBMIT

1 Answer

6 votes

Answer:

sqrt(sqrt(x))

Explanation:

The problem statement tells you how to do it: take the square root, then the square root of that, using the square root function twice and making the result of one the argument of the other.

User Goows
by
5.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.