Plz tell me what’s wrong with this?
Modular exponentiation
@Kush_1312,
at worst case you are trying to calculate 100000^100000, which is 10^500000 i.e a number containing 5,00,000 digits. No data type can store a number this big, leave alone taking its modulo. So since this number is certainly out of range of data type, value overflows, to give wrong answer.
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.