foreach Loop C# with Example



foreach Loop C# with Example

 	using System;

	namespace CSharpFundamentals
	{
		class foreachLoop
		{
			private static void Main(string[] args)
			{
				int [] rollnumbers = new [] {100, 200, 300, 400};
				
				foreach(int rollnumber in rollnumbers)
				{
					Console.WriteLine("Roll Number: {0}", rollnumber);
				}
			}
		}
	}
 

0 Comment's

Comment Form