Hello, I'm working on my Computer Science project but I can't figure out what's wrong with my code!
for (int x = 1; x <= Expo; x++)
{
for (int i = 1; i <= Expo; i++)
{
Output.setText(Base + " to the exponent " + i + " = " + pow(Base,i) + "\n");
}
}
The output I'm trying to get looks something like this (assuming the base is 2 and the exponent is 10):
2 to the power of 1 = 2
2 to the power of 2 = 4
2 to the power of 3 = 8
2 to the power of 4 = 16
2 to the power of 5 = 32
2 to the power of 6 = 64
2 to the power of 7 = 128
2 to the power of 8 = 256
2 to the power of 9 = 512
2 to the power of 10 = 1024
But the output that I'm getting (still assuming the base is 2 and the exponent is 10):
2 to the power of 10 = 1024
Please help! Thanks, Rara