1 2 3 4 5 6 7 8 9 10 11 12
#include <stdio.h> #include <stdlib.h> unsigned power(unsigned x, unsigned y) { if (y == 0) { return 1; } if (y == 1) { return x; } return x * power(x, y-1); }