how printspellings(n/10) works and after that how n%10 works in this case
What work n/10 doing
Hey @TheSourabh
So first thing u need to know
if n=2048
then n/10 is equalt to 204 i.e quotient(or integer) part after dividing by 10
and n%10 is equal to 8 that is remainder after deleting by 10
So now printspelling(n/10) remove last digit and call for smaller part
i.e printspellings(2048) calling printspellings(204) which is calling printspellings(20) which calls printspellings(2)
Now since we are doing n/10 in argument we are not updating actual value of n so n%10 is extracting last digit and adding corresponding string to answer string later
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.