Micron Technology Interview Question

How to calculate exponent using a loop in C?