difference between for and foreach in c#
Answers
Answered by
1
For loop are appropriate loops when you know exactly how many times iteration you wants in statements within the loop.
For loop iterates a statement or a block of statements repeatedly until a specified expression evaluates to false
Foreach loop is used to iterate through the item in object collections,list generic collections or array list collections.
For loop iterates a statement or a block of statements repeatedly until a specified expression evaluates to false
Foreach loop is used to iterate through the item in object collections,list generic collections or array list collections.
Similar questions