Synopsys interview question

Write a function that calculates a^b % c.