using System;
public class exam
{
public static void Main()
{
string[] arr =new string[5];
arr[0] ="Steven";
arr[1] ="Clark";
arr[2] ="Mark";
arr[3] ="Thompson";
arr[4] ="John";
//retrieving value using foreach loop
foreach(string name in arr)
{
Console.WriteLine("\nHello "+ name);
}
}
}C#
Loopin Statement : for each Statement

Written by
View ProfileSenthilvelan Sambamoorthy
Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.
