How do we reverse a number with leading zeroes in number ? For ex: If input is 004, output should be 400.
I wrote below program but it works only when n
Once you convert your input to an integer, which you do in line 3, any information about the leading zeroes in the input of the user is lost.
You'll have to use a string.