So I have been playing around with C# lately and I don't understand output formatting.
using System;
namespace Arrays
{
class Program
{
static void Main()
{
Random r = new Random();
int[] Numbers = new int[10];
for (int i = 0; i < Numbers.Length; i++)
{
Numbers[i] = r.Next(101);
}
for (int i = 0; i < Numbers.Length; i++)
{
Console.WriteLine("index {0} holds number {0}", i,Numbers[i]);
}
}
}
}
Output
My expected output was index i holds number Number[i]
. So can anyone explain what to change, or link me with a good C# page on output formatting topic.
I know there is a way to do it in 2 lines.