Posted by : Sudhir Chekuri Thursday, 31 December 2015

Do while loop executes a set of statements inside it atleast once and repeated till the condition is met.

Syntax

Do

{

<statements>

} while(condition);

C#.NET DoWhile Example program

Program

using System;
namespace DoWhileLoop
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            do
            {
                Console.WriteLine(i);
                i++;
            } while (i < 10);
            Console.ReadKey();
        }
    }
}

Output

0
1
2
3
4
5
6
7
8
9

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Followers

Total Pageviews

Powered by Blogger.

Blog Archive

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -