Console App : Use Choose Function to Check the Month of the Year

Posted by Chikul under VB.NET category on | Views : 2891

Module Module1

Sub Main()
Dim str As String
Dim Year As String
Console.WriteLine("Enter nth Month of Year :")
str = Console.ReadLine()
If IsNumeric(str) And (Val(str) > 0 And Val(str) < 13) Then
Year = Choose(CInt(str), "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Console.WriteLine("Entered Month is " & Year)
Console.WriteLine(str & " is not a Valid Month of the Year.")
End If
End Sub

End Module

Comments or Responses

Login to post response