// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; namespace Logging { public class Test { public static int Fac(int n) { int res; if (n <= 1) { res = 1; } else { res = n * Fac(n - 1); } Console.Error.WriteLine("fac : n = " + n + " res = " + res); return res; } public static void Main(string[] args) { Console.WriteLine(Fac(50)); } } }