For loop and foreach loop in c#.net

1) For loop executes a statement or block of statements repeatedly until a specified expression evaluate to false.
2) In for loop there is need of initializing min, max, and condition in for loop.
3) But foreach loop everything is treated as a collection and it creates an instance of an enumerator.It keeps state throughout the foreach.



Comments