Doubt doubt doubt

https://ide.codingblocks.com/s/480087 —> Problem???

hello @parth_tyagi

ss

use mod properties in these lines(20,22) as well

nahi samaj aaya. https://ide.codingblocks.com/s/480130 ???

check now

ok. me samajh gaya–> ex: (2^2 * 2^3)% 3 = [ (2^2%3) * (2^3&3) ] %3 —> aap ye kar rahe ho har step ke liye. Par Kyu?? Reason???

agar me end me mod lunga to bhi to same answer aaega.

…

overflow avoid karne ke liye.

nahi same nahi aayega overflowed result pe mod karoge to exxpected result nahi aayega

poperty -> (a*b)%c= (a%c * b%c)%c

ye isi property ki help se hum har step pe mod kar paa rahe hai

a = (a * a)%c;//take mod —> ye kyu kar rahe h. Aap code kese work kar raha h samjha sakte ho ek baar…

read about modular exponentiation technique, then only things will make sense to u

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.