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):
#include <iostream>
#include <cmath>
usingnamespace 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;
}