Regarding Modular Exponention prorgram

There is a program in which we have to find value of (a^b)%c in which ^ represents power but my program is not passing all test cases.https://ide.codingblocks.com/s/481853

you have to make your own function
because constraints are very large
so a^b is much much large and you can’t store them in any data type that is why you have to take mod

this mod should be taken in successive calculation because final ans is very large so it is overflowed and then taking mod is not useful

Reference Code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.