Loop Structures

Loops allow you to repeats a segments of code multiple times. C# has three basic types of loops.You choose the types of loop based on the type of task you need to perform. Your choices are as follows:

- You can loop a set of number of times a for loop.
- You can loop through all the times in a collection of data using a foreach loop.
- You can loop while a certain condition holds true, using a while loop.

No comments:

Post a Comment