CSharp examples for Language Basics:do while
ensuring that the block is always executed at least once.
Here's the preceding example rewritten with a do-while loop:
using System;/*from w ww . j a va2 s. c o m*/ class Test { static void Main(){ int i = 0; do { Console.WriteLine (i); i++; } while (i < 3); } }