Next time you get chance to write a code.. use action as procedure to do your task. Recursive Lamda Expression using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Actioncountdown = null; countdown = (i) => { if (i > 0) { Console.WriteLine(i); countdown(i - 1); } }; countdown(5); Console.Read(); } } }
No comments:
Post a Comment