Skip to main content

Write a Vb.net program to accept a character from keyboard and check whether it is vowel or not. Also display the case of that character.

· One min read
Kaustubh Kulkarni
file.vb
  
PublicClass Form1
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim c AsString
Dim asc1 AsInteger
c = TextBox1.Text
asc1 = Asc(c)
' MsgBox(asc1)

If c = "a"Or c = "A"Or c = "e"Or c = "E"Or c = "i"Or c = "I"Or c = "o"Or c =
"O"Or c = "u"Or c = "U"Then
If asc1 <= 122 And asc1 >= 97 Then
MsgBox("vowel in Lowercase")
Else
MsgBox("vowel in Uppercase")
EndIf
ElseIf asc1 <= 122 And asc1 >= 97 Then
MsgBox("Not Vowel in Lowercase")
Else
MsgBox("Not Vowel in Uppercase")
EndIf
EndSub
EndClass