Microchip Technology interview question

they asked me to code a simple c utility function.