Observations and suggestions
- The comparation of a>0 should be done at the very begining of the program (after the value of "a" is obtained).
Your comparation for the largest/smallest is not correct.
Try a different approach:
- If I input 1234, it will only display the largest number
- If I input 4321 it will only display the lowest number and ...
- If I input 1539, neither is displayed
Compare the first digit against the rest of the digits. For example:
- if b>c, then largest = b
- if not, then c is larger than b therefore largest = c
- then comparare "largest" against the next digit. Once you find a larger number, make it "largest" value
- Do the same for the "smallest" value