unsigned int power(unsigned int x, unsigned int y) { unsigned int result = 1; while (y > 0) { result *= x; y--; } return result; }