Wrong answer in different test case

i am getting wrong answer in different test case can you tell my mistake in this code?

@aditikandhway
your code is correct but there is slight mistake. Use %c operation in power() function itself. It is possible that final ans cann’t get stored in long long int but it’s modulus with c can. So pass c as argument in power() function and change line 11 to ans=(ansa)%c; and line 13 to a=(aa)%c;

https://ide.codingblocks.com/s/262239
here is the updated code and is working for all cases.