So I'm supposed to create a base and an exponent variable. Then by using a for loop I should be able to output the result. E.g 2 raised to the power of 2 should be for, or 2 to the power of 5 should be 32.
Here is what I got but it's not right.
1 2 3 4 5 6 7 8 9 10
int y = 1;
for (int x = 1; x < 10; x++)
{
cout << x << " raised to the power " << y << endl;
cout << x;
y++;
cout << endl;
}
I'm only supposed to use for loops for this one, not functions.