Skip to content

Instantly share code, notes, and snippets.

@slavaceornea
Last active June 8, 2016 09:25
Show Gist options
  • Save slavaceornea/bf20e3698a22f7c6447a494a6ae65838 to your computer and use it in GitHub Desktop.
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.
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