VB.net program to create a tuple to find out Even/Odd numbers

Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 918
The below program will do so

Private Shared Function GetEvenOddNumbers() As Tuple(Of List(Of Integer), List(Of Integer))
Dim numbers = Enumerable.Range(1, 20)
'generate numbers between 1 to 20
'find even numbers list
'find odd numbers list
Return Tuple.Create(numbers.Where(Function(i) i Mod 2 = 0).ToList(), numbers.Where(Function(i) i Mod 2 <> 0).ToList())
End Function

Comments or Responses

Login to post response