What is the alternative of For Loop?

 Posted by Rajesh_Kumar on 1/18/2014 | Category: C# Interview questions | Views: 598 | Points: 40
Answer:

Foreach loop is an alternative of For Loop.
We get the same output with Foreach loop as with For Loop

For Example:-

foreach(string values in arr_list)

{
MessageBox.Show(values);
}


Where arr_list is an ArrayList.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response