C# Foreach loop

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 item present in the list. For example, … Read more