Want to create interactive content? It’s easy in Genially!
Get started free
Iterating through arrays using loops in C#
Adam Wingell
Created on February 17, 2025
Start designing with a free template
Discover more than 1500 professional designs like these:
Transcript
Iterating through arrays using loops in C#
Using a Foreach loop with Arrays
Searching through Arrays using Loops
Using For loops with Arrays
Using For loops with Arrays
In this example we use both an Array and a for loop to print out the numbers within the array to console. The only thing we change from normal is the condition and the output. The condition is changed to the length of the array and the output is the array with its current iterated position.
Using a Foreach loop with Arrays
A foreach loop simplifies the loops of arrays by saying iterate the amount of numbers in the numbers array output the number within the array.