#include <stdio.h>
int powInt(int base, int exp) {
int result = 1;
for (;;) {
if (exp & 1)
result *= base;
exp >>= 1;
if (!exp)
break;
base *= base;
}
return result;
}
int main() {
int x = 5;
printf("x^3: %d\n", powInt(x, 3));
return 0;
}
/*
run:
x^3: 125
*/