cbrt()

christian.dinh2481 total contributions
Published Jul 20, 2021Updated Jul 31, 2023
Contribute to Docs
The cbrt()
function returns the cube root of the argument.
Syntax
std::cbrt(n)
Example
Use cbrt()
to find the side lengths of a 27
m3 cube:
#include <iostream>#include <cmath>int main() {double V = 27;double side;side = std::cbrt(V);std::cout << "A cube with a volume of " << V << " has a side length of " << side << "\n";}
This results in the following output:
A cube with a volume of 27 has a side length of 3
Codebyte Example
Use cbrt()
to find the cube root of 8
:
All contributors
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- StevenSwiniarski475 total contributions
- GaVi-_3 total contributions
- Christine_Yang271 total contributions
- garanews222 total contributions
- christian.dinh
- Anonymous contributor
- StevenSwiniarski
- GaVi-_
- Christine_Yang
- garanews
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.