Home > DeveloperSection > Forums > do While Loop In c#
Ankit Singh

Total Post:341

Posted on    December-01-2015 9:49 PM

 C# C#  Loop 

 1 Reply(s)
 707  View(s)
Rate this:
I want to use do While Loop in c# Please Help me how to use it.

aditya kumar Patel

Total Post:254

Posted on    December-01-2015 9:50 PM

do while loop treats same as while loop but only differences between them is that, do while executes at least one time. The code executes first then check for specified loop condition. But in while loop, the specified loop condition evaluated first then executes the code.

using System;
namespace dowhile
    class Program
        static void Main(string[] args)
            int Number, i, Result;
            Number = 12;
            i = 1;
                Result = Number * i;
                Console.WriteLine("{0} x {1} = {2}", Number, i, Result);
            while (i <= 12);


Don't want to miss updates? Please click the below button!

Follow MindStick