Last active
June 8, 2016 09:25
-
-
Save slavaceornea/bf20e3698a22f7c6447a494a6ae65838 to your computer and use it in GitHub Desktop.
C/C++/C#/Java code that puts all the digits of a number n into an array for further processing.
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[] inputArray = new int[10]; | |
int i = 0; | |
while (n != 0) { | |
inputArray[i] = n%10; | |
n /= 10; | |
i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment