Cube root of the number by R4R Team

Example-
Cube root of 8 is 2
Cube root of 27 is 3
Cube root of 64 is 4

program-

#include< stdio.h>
#include
int main()
{
int n;
float ans;
printf("Enter number\n");
scanf("%d",&n);
ans=pow(n,1.0/3.0);
printf("Cube root is %f",ans);
}


output-

Enter number
27
Cube root is 3.000000

-In this program, we take a input of the integer number and try to find the cube root of that number.
-We include the math library for the pow() function that are define in that library.
-pow(n,1.0/3.0) are able to return the required answer.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!