CSharp examples for Language Basics:do while
do...while iteration statement.
using System;/*ww w . j av a2 s.c o m*/ class DoWhileTest { static void Main() { int counter = 1; // initialize counter do { Console.Write($"{counter} "); ++counter; } while (counter <= 10); // required semicolon Console.WriteLine(); } }