#include using namespace std; typedef unsigned short USHORT; typedef unsigned long ULONG; ULONG GetPower(USHORT n, USHORT power); int main() { USHORT number, power; ULONG answer; cout << "Enter a number: "; cin >> number; cout << "To what power? "; cin >> power; answer = GetPower(number,power); cout << number << " to the " << power << "th power is " << answer << endl; system("PAUSE"); // prevent the console window from closing return 0; } ULONG GetPower(USHORT n, USHORT power) { if(power == 1) return n; else return (n * GetPower(n,power-1)); }