I want to write a simple program that determines whether the number the user inputs is increasing, strictly increasing, etc. etc.
To solve this I want to break up each digit and see if they are always getting smaller or not, etc.
How do I break up the input into separate digits using scanf function?
One has to wonder why you’re not getting the input as integers in the first place (
%lluperhaps?) – this would make comparisons so much easier. However, you could get each line from the user viafgetsand then parse each character.Since you mention you want to read large numbers:
Or maybe: