else error: expected a statement

I'm writing a simple program that takes two values and raises the first to the power of the second. The compiler is underlining that last "else" and giving me the error "expected a statement." The syntax looks okay to me. I'm sure it's a simple mistake. Thanks for any help!

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
int main()
{
	int base;
	int power;
	cout << "Please enter a base integer and the power integer you would like to raise it to.\n";
	cin >> base >> power;

	double result = base;

	if (power == 0)
		cout << "The resulting value is 1\n";
	else if (power > 1);
	{
		for (int i = 1; i < power; i++)
			result *= base;
		cout << "The resulting value is " << result << "\n";
	}
	else
	{
		result = 1;
		for (int i = -1; i > power; i--)
			result /= base;
		cout << "The resulting value is " << result << "\n";
	}
}
else if (power > 1); Remove the ; at the end
AHHHHH!!!! Haha I knew it would be something simple. Thank you :)
Topic archived. No new replies allowed.