C# Foreach loop

C# Foreach Loop 1

The C# Foreach loop is useful to iterate through each item in a collection. Generally, this foreach loop is helpful with ArrayList, Generics, etc. The syntax of the C# foreach loop is foreach(<datatype> <variable> in <list>) { statements; } Here, the <datatype> is nothing but the type of the item present in the list. For … Read more