What do you mean by do and while statements in C# programming language?

 Posted by Goud.Kv on 9/1/2014 | Category: C# Interview questions | Views: 278 | Points: 40
Answer:

Similar to 'switch and case' statements, do executes the entire statement block repeatedly until it meets a false evaluation which is stated by while.

Example,
int x = 3;

do
{
Console.WriteLine(a); // This will print from 3 to 8 (because of while)
a++;
}
while (a < 9);


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response