English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C ++The cbrt() function in returns the cube root of the number.
∛x = cbrt(x)
This function is in<cmath>defined in the header file.
double cbrt(double x); float cbrt(float x); long double cbrt(long double x); double cbrt(T x); // For integral type
The cbrt() function takes a parameter to calculate its cube root.
The cbrt() function returns the cube root of the given parameter.
#include <iostream> #include <cmath> using namespace std; int main() { double x = -1000.0, result; result = cbrt(x); cout << "-10The cube root of 00 is " << result << endl; return 0; }
When running the program, the output is:
-10The cube root of 00 is -10
#include <iostream> #include <cmath> using namespace std; int main() { long x = 964353422; double result = cbrt(x); cout << "964353422The cube root is " << result << endl; return 0; }
When running the program, the output is:
964353422The cube root is 987.974