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