Doubt in my code

Here is my code.
It is working perfectly in case

Input is 63
Output is 77

But in case

Input is 112
Output is 16 instead of 160

What is the solution to this problem?

hello @yashsharma4304
it will not work becuase when u will try to store

061 then it will be stored as 61 only (in integers we cant have leading zeros).
and when u reverse 61 ,u will get 16

check now->

1 Like

Ok. Thank You. Now, it’s working. Thanks for resolving my doubt. :slightly_smiling_face: