With the given input, your program outputs
025
, which isn't half bad. Adding newlines between the numbers is a no-brainer. And if the leading zero bothers you, then please take notice that your
scanf
call consumes the number but not the end-of-line character following it. Once you've got it debugged (that's part of the job), please apply for a
code review, as I see a lot of bad practices in your code. You'll do fine; good luck! —
Ruud just now