143k views
5 votes
Write, compile, and execute a C program that calculates and returns the fourth root of the number 81.0, which is 3. (hint: The fourth root of a number can be obtained by raising the number to the 1/4 or .25 power).

User Mark Maxey
by
6.5k points

1 Answer

5 votes

Answer:

result=pow(value,0.25);

printf("The 4th root is:%2.f",result);

Step-by-step explanation:

In order to accomplish the task we need a library called math.h.

//4 root code

#include <stdio.h>

#include <math.h> //adding the library math.h

int main()

{

double value=81.0,root=0.25,result; //declaring the variables

result=pow(value,root); //The function Pow will return the power raised to the base number

printf("The 4th root is:%2.f",result); //print the result

return 0;

}

Write, compile, and execute a C program that calculates and returns the fourth root-example-1
User Kanak Singhal
by
6.3k points