+ 8
How to find a cube root in c++??
Give relevant code
6 Respuestas
+ 3
Thanks, but it seems that it's not full c++, it has combination to other language
+ 5
You may use either pow() or cbrt(), but cbrt() is specialized for precision and would be a better choice. EDIT: Also, cbrt() works when you have a negative base, whereas pow() does not.
It might be a more C++ oriented way to use stdc++.h which includes math.h, but I don't know if there is any difference.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << pow(27.0, 1.0/3.0) << endl;
cout << cbrt(27.0) << endl;
return 0;
}
+ 3
Thank you for your response
I'm interested in learning python but I don't know which compiler I can use for window
+ 3
Ookey is Anaconda a text-editor or interpreter
+ 3
Thank you bro
+ 1
Looking for python IDE, you might like this
https://www.jetbrains.com/pycharm/