Equation problem?

I'm trying to write a program that will ask you witch answer do you want to be written (outputed), x or y? Sadly I don't have enough skill to solve this, can anyone help me with this?

this is the equation: x^2 + 4 = y^3

So the answer for x should be 2, and the answer for y should also be 2. At least I think.

Here is my badly written program(Please don't laugh):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cmath>

using namespace std;

int main () {

    int a = pow(1, 2);
    int b = pow(1, 3);
    int c = 4;

    int equation = a + c;
    equation = a;

    if (a + c != b) {
        a++;
        b++;

        cout << "Which solution do you want?";

        cout << a << endl;
        cout << b << endl;
        }else {
          return 0;
               }
}

return 0;
}


MediumSolid wrote:
answer for x should be 2, and the answer for y should also be 2
Isn't answer for x is ±√(y³ − 4) and for y is ³√(x² + 4)?
That would be the more precise answer, but i don't think that would be it. It would be too easy than.
Topic archived. No new replies allowed.