Do / while loop with a console read : Do While « Statement « C# / CSharp Tutorial






using System;
using System.IO;

class MainClass
{
  public static void Main(string[] args)
  {
    string ans;
    do
    {
      Console.Write("Are you done? [yes] [no] : ");
      ans = Console.ReadLine();
    }while(ans != "yes");
  }
}
Are you done? [yes] [no] : yes








4.6.Do While
4.6.1.Do while loop
4.6.2.Display the digits of an integer in reverse order with do while loop
4.6.3.Using break to exit a do-while loop
4.6.4.Use the do while statement to implement Newton's method for finding the square root of a number
4.6.5.Do / while loop with a console read