// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static void Main(string[] args) { int tmp = 123456789; int n = 1 + (int)Math.Log10(tmp); int[] digs = new int[n]; for(int i = 0; i < n; i++) { digs[n-i-1] = tmp % 10; tmp /= 10; } foreach(int dig in digs) Console.WriteLine(dig); } } }