C++ Programming Code Examples C++ > Mathematics Code Examples Cube Root of Number in C++ Programming Cube Root of Number in C++ Programming To find cube root of any number we need to find 0.3 power of any number. For example if you need to find cube root of 27 then calculate 0.3 power of 27, result is 3. And one another method for this program is use cbrt() function it is pre-defined in math.h header file. #include<iostream.h> #include<conio.h> #include<math.h> void main() { int num, ans; clrscr(); cout<<"Enter any number"; cin>>num; ans=pow(num, 1.0/3.0); ans++; cout<<"\n\Cube of "<<num<<" is: "<<ans; getch(); }