How to Write a for loop in C# For loops allow you to cycle, or iterate, through data easily. They are useful when a programmer wants to perform repetitive tasks on a group of items automatically. Watch this video on how to write a for loop in C# in order to understand the details you will need as a computer programmer.