i am not getting the correct answer. please explain??
How to solve there questions?

this is not correct.
also dont use pow function number a^b is very big number we can not compute direclty, use modular exponentiation technique to solve this problem.