Modular Exponential

hello,
for this question I am applying
pow(a,b)%c will be equal to pow(a%c,b%c)%c

but it is no giving proper result

@akshatjain4545 i dont think it will work pow(2,5)%5 is 2 but pow(2%5,5%5)%5 is 1

@talhashamim001, No it will work
2%5=2 & 5%5=1
so, pow(2%5,5%5)=pow(2,1) which is 2

hi @akshatjain4545 buddy refer for modulo 5%5 is 0

@talhashamim001 sry sr,
Then what should be the approach

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.

No my doubt is not cleared yet

hi @akshatjain4545 u can do like this

Hi @talhashamim001
your code is not visible

@akshatjain4545

@talhashamim001, ok sr