Modular Exponentiation


Why is this not working?

@tanyaa.sood
You need to intialize ans with 1 and ans=((a%m)(a%m))%m; would change to ans=((ans%m)(a%m))%m;