Modular Exponentiation

My Code is : https://ide.codingblocks.com/s/212288

I am not able to pass one test case, please tell the mistake in my code.

@aryanrathee
hello Aryan,
use long long datatype for your ans variable.

also we have O(log(n) ) algorithm to calculate exponents so do check that as well.