foreach Loop Multi- Dimensional Array C# with Example



foreach Loop Multi- Dimensional Array C# with Example

 	using System;

	namespace CSharpFundamentals
	{
		class foreachLoopMultiDimensionalArray
		{
			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

Submit Comment