HI,
Is it possible that neither we are reaching infinity nor we are getting cycle?
Problem explanation
hello @vatsal50
no its not possible.
see we are given int
and int can have atmost 9 - 10 digits(let say 10) , so after one step the highest number that we can get is 810 ( all 10 digits are 9 , 10 * 9 ^ 2 )
so here we can say our range is bounded [0…810]
hence it will take finite steps . . . .
Please explain this int can have atmost 9 - 10 digits(let say 10)
largest number that an int datatype can hold wiLL have atmost 10 digits.
just check how many digit INT_MAX constant has.
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.