In C++, the cbrt() function is defined in the <cmath> header file and is used to calculate the cube root of a given number. It returns the value whose cube is equal to the specified argument.
The cbrt() function supports integer, float, double, and long double values.
It has the following syntax.
Syntax would be.
arg: It is the value of float or integer type.
It returns the cube root of a given number arg.
Here, we are going to discuss several examples to demonstrate the List cbrt() Function Function.
This example demonstrates how the cbrt() function calculates the cube root of an integer value.
Output:
Cube root of a number is :2
This example demonstrates how the cbrt() function calculates the cube root of a floating-point value.
Output:
Cube root of a number is :2.33921
This example demonstrates how the cbrt() function calculates the cube root of a negative number. Unlike sqrt(), the cbrt() function can return valid results for negative values.
Output:
Cube root of a number is : -3
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India