my suggestion would be , If you are taking the value from STDIN from the user.
Then if you want to use that value for printing purpose, then you need to store that integer with leading zeros into a string rather than an integer. Because leading zero has no meaning if you are storing that string value in an integer.
so %s in printf with retain the number of zeroes that user has enetered in that way.