Imports System
Public Module Module1
Public Sub Main()
'Create a 20 item array
'Input a value and assign to the first item
'The other values are obtained from this formula:
'If the index is odd the value is 10 more than the first value
'If the index is even the value is 10 less than the first value.
'Print out the array using the for each syntax
dim a,i as integer
dim array() as integer = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190}
console.WriteLine("Input a number:")
a = console.ReadLine()
if a mod 2 = 0 then
for i = 0 to 19
Console.WriteLine(a - array(i))
next
else
console.WriteLine(array(i) + a )
end if
End Sub
End Module