.NET Practical Slip 5 Q A

2. Slip-1 Problem Statement

Q. 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. 15 Marks

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
Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top