You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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 do_while
{
class Program
{
static void Main(string[] args)
{
int table,i,res;
table=12;
i=1;
do
{
res = table * i;
Console.WriteLine("{0} x {1} = {2}", table, i, res);
i++;
}
// must put semi-colon(;) at the end of while condition in do...while loop.