I need to write a program in C++ which prints all of the numbers between -50 and 0 that satisfy the equation: 18^3-18x^2+6=0
My if statement doesn't seem to return any results, it should :(
I think I'm along the right lines....
for (int x = -50; x < 0; x++) {
int y = pow(x, 3) - 18 * pow(x,3) + 6;
if(y == 0)
cout << y << endl;
}
Any help would be appreciated.