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

Output:-


Design:-

    1) Open visual basic 
    2) Add Module 
    3) Save it as slip10.vb 
    4) Select Startup form as slip10.vb and Select Application type as Console Application save this and run this program.
   

0 Comments