Foreach Loop

Foreach Loop

The foreach loop is yet another looping structure in C# which is specially designed for arrays, lists, and collections.The foreach loop cycles through each of the elements, placing the element's value into a…