C# – Looping with while and do… while Iteration Statement

Again a short serie of today’s post.

Random random = new Random();

random.Next(lowerbounds, upperbounds);

random.Next(1,100); //returns a value 1 and 100

if someExpression already false, this will never execute

while(someExpression){

 code that would affect whether someExpression is true or false

}

if some expression is already false, this will run AT LEAST ONCE

do{

 code that would affect whether some expression is true or false

}while(someExpression)

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.