Home > DeveloperSection > Forums > foreach loop In c#
Ankit Singh

Total Post:341

Posted on    December-06-2015 9:38 PM

 C# C# 

 1 Reply(s)
 441  View(s)
Rate this:
I want to use foreach loop in c# please help me.

aditya kumar Patel

Total Post:254

Posted on    December-06-2015 9:43 PM

foreach loop is a different kind of looping constructs in C# programming that doesn’t includes initialization, termination and increment/decrement characteristics. It uses collection to take value one by one and then processes them.

using System;

using System.Collections;

namespace ForEachLoop


class Program


static void Main(string[] args)


ArrayList list = new ArrayList();

list.Add("Suresh Kumar");

list.Add("Sanjay Kumar");

list.Add("Sunil Patel");

list.Add("Vinay Singh");

list.Add("Arun varma");

list.Add("Manoj Kumar");

foreach (string name in list)






Don't want to miss updates? Please click the below button!

Follow MindStick