Iam Beginner in programming and i have a question. how make algorithm for cube root finding in C++ without using functions like pow(). The user enters the number and the number of decimal places.
My code: My do while isn't working
double number;
cout << "Enter number = ";
cin >> number;
int x;
int y = number / 3.;
int i;
cout << "Enter i = ";
cin >> i;
do {
x = y;
y = (2. * x + number / (x * x)) / 3.;
} while (abs(x - y) >= i);