Get Month Name
This blog shows an example how to get month name by entering month no in VB.NET
Module Example9
Sub main()
Dim MonthNum As Integer
Console.Write("Enter a Month Number 1-12 :")
MonthNum = Console.ReadLine()
If MonthNum = 1 Then
Console.WriteLine("January")
Else If MonthNum = 2 Then
Console.WriteLine(" February ")
Else If MonthNum = 3 Then
Console.WriteLine(" March")
Else If MonthNum = 4 Then
Console.WriteLine(" April ")
Else If MonthNum = 5 Then
Console.WriteLine(" May ")
Else If MonthNum = 6 Then
Console.WriteLine(" June ")
Else If MonthNum = 7 Then
Console.WriteLine(" July")
Else If MonthNum = 8 Then
Console.WriteLine(" August ")
Else If MonthNum = 9Then
Console.WriteLine(" September ")
Else If MonthNum = 10 Then
Console.WriteLine(" October ")
Else If MonthNum = 11 Then
Console.WriteLine(" November ")
Else If MonthNum = 12 Then
Console.WriteLine(" December ")
Else
Console.WriteLine("Invalid Input")
End If
End Sub
End Module
The above example is same as getting day name by entering day number which we have seen in previous blog
No comments:
Post a Comment