Created
February 10, 2017 21:47
-
-
Save sarpeedo/e12fe23db8273e19adb3a8a3b5087e19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int q = 22222; // lots of digit number | |
while (q > 9) { | |
digit = q % 10; // do something useful here with the digit | |
q = q/10; // so in the first pass 22222 -> 2222 (remember division truncates does not round) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment