new array of doubles c# code example Example: c# create array with n elements int[] arr = Enumerable.Range(0, X+1).ToArray();