Write a VB.NET program to accept a character from the keyboard and check whether it is a vowel or consonant. Also, display the case of that character.

Answer:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim ch As Char
        ch = TextBox1.Text
        Select Case ch
            Case "A", "E", "I", "O", "U"
                MessageBox.Show(ch + " is Vowel And UpperCase")
            Case "a", "e", "i", "o", "u"
                MessageBox.Show(ch + " is Vowel And LowerCase")
            Case Else
                MessageBox.Show(ch + " is consonant")
        End Select
    End Sub
End Class
Scroll to Top