Micron Technology interview question

How to calculate exponent using a loop in C?