3
 A loop is a control statement that allows repeating execution of a block of statements  May execute a code block fixed number of times  May execute a code block while given condition holds  May execute a code block for each member of a collection  Loops that never end are called an infinite loops

26
 Executed once, just before the loop is entered  Like it is out of the loop, before it  Usually used to declare a counter variable for (int number = 0;...;...) { // Can use number here } // Cannot use number here

27
 Evaluated before each iteration of the loop  If true, the loop body is executed  If false, the loop body is skipped  Used as a loop condition for (int number = 0; number < 10;...) { // Can use number here } // Cannot use number here

28
 Executed at each iteration after the body of the loop is finished  Usually used to update the counter for (int number = 0; number < 10; number++) { // Can use number here } // Cannot use number here

38
 The typical foreach loop syntax is:  Iterates over all elements of a collection  The element is the loop variable that takes sequentially all collection values  The collection can be list, array or other group of elements of the same type foreach (Type element in collection) { statements; }

39
 Example of foreach loop: string[] days = { "Monday", "Tuesday", "Wednesday", "Thursday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }; "Friday", "Saturday", "Sunday" }; foreach (string day in days) { Console.WriteLine(day); Console.WriteLine(day);}  The above loop iterates of the array of days  The variable day takes all its values  In the foreach loop we cannot set the value of the current item

48
 Jump statements are:  break, continue, goto  How continue works?  In while and do-while loops jumps to the test expression  In for loops jumps to the update expression  To exit an inner loop use break  To exit outer loops use goto with a label  Avoid using goto ! (it is considered harmful)