# Arrays and Loops in C#

Arrays hold many values of the same type under one name, and loops repeat work for each of them. You will create and read arrays, then loop with while, do-while, for, and foreach.

Updated: November 3, 2026

## [Arrays in C#](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/arrays-in-csharp)

1. [Introduction to Arrays](https://www.ask-codey.com/lessons/arrays-in-csharp-introduction-to-arrays) (Novice): An array keeps many values of the same type together in one fixed-size container, like eggs in a carton.
2. [Array Basics](https://www.ask-codey.com/lessons/arrays-in-csharp-array-basics) (Novice): Create C# arrays, read and change their elements by index starting at 0, and use Length to find the last one.

## [Looping in C#](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/looping-in-csharp)

1. [While Loop](https://www.ask-codey.com/lessons/looping-in-csharp-while-loop) (Novice): Repeat a block of code for as long as a condition stays true with C#'s while loop, and make sure the loop can end.
2. [Do-While Loop](https://www.ask-codey.com/lessons/looping-in-csharp-do-while-loop) (Apprentice): Run a block of code at least once, then repeat it while a condition is true, with C#'s do-while loop.
3. [For Loop](https://www.ask-codey.com/lessons/looping-in-csharp-for-loop) (Novice): Count through a range of numbers, or through an array's indexes forward, backward or in steps, with C#'s for loop.
4. [Foreach Loop](https://www.ask-codey.com/lessons/looping-in-csharp-foreach-loop) (Apprentice): Visit every element of an array without an index using C#'s foreach loop, and leave a loop early with break or skip ahead with continue.

## [Exercise: Arrays and Loops](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/exercise-arrays-and-loops)

1. [Exercise: Arrays and Loops](https://www.ask-codey.com/lessons/exercise-arrays-and-loops) (Apprentice): Solve 17 problems with arrays and loops (filling, searching, totaling, finding the highest and lowest, reversing) and check each with tests.

Source: https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/chapters/arrays-and-loops-in-csharp
