CSharp examples for Language Basics:do while
Do While Iteration Statements
using System;//from w w w. j a v a 2 s. co m using static System.Console; class Program { static void Main(string[] args) { string password = string.Empty; do { Write("Enter your password: "); password = ReadLine(); } while (password != "secret"); WriteLine("Correct!"); } }