---
title: "foreach loop In c#"  
description: "foreach loop In c#"  
author: "Anonymous User"  
published: 2015-12-06  
updated: 2015-12-06  
canonical: https://www.mindstick.com/forum/33685/foreach-loop-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# foreach loop In c#

I want to use [foreach loop in c#](https://www.mindstick.com/interview/33898/foreach-loop-in-c-sharp) please help me.

## Replies

### Reply by Anonymous User

[foreach loop](https://www.mindstick.com/forum/182/problem-in-getting-the-value-from-array-by-using-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)                Console.WriteLine(name);            Console.ReadLine();        }    }}
```

![foreach loop In c#](https://www.mindstick.com/mindstickforums/45e228d0-cb5d-42e8-b950-80c5b10713af/images/bd63df70-0ffa-4ed6-a954-c02362eff9db.png)


---

Original Source: https://www.mindstick.com/forum/33685/foreach-loop-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
