Please help! Arrays and mathematical functions

What I'm supposed to do is make an array of 10 with those numbers, then ask user for a number between 1 and 8 then get the sum of the user's input and (n-1) + (n) + (n+1) indexes.

Here's what I have so far… not sure how to proceed after

 int[] n = new int[] { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 }; int input; Console.WriteLine("Please enter a number from 1 to 8"); input = Convert.ToInt32(Console.ReadLine()); 

by Vaibe via /r/csharp

Leave a Reply