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.
Program:-
Module slip10
Sub main()
Dim vowel As Integer
Dim c As String
Dim a() As String = {"a", "e", "i", "o", "u", "A", "E", "I", "O", "U"}
Console.Write("Enter character: ")
c = Console.ReadLine()
For i As Integer = 0 To a.Length - 1
vowel = 0
If c = a(i) Then
vowel = 1
Exit For
Else
vowel = 0
End If
Next
If vowel = 1 Then
Console.WriteLine("Character is vowel")
Else
Console.WriteLine("Character is not vowel")
End If
Console.ReadKey()
End Sub
End Module
0 Comments