VB.Net Program to Demonstrate the Nested ‘Select Case’

You are currently viewing VB.Net Program to Demonstrate the Nested ‘Select Case’

VB.Net program to demonstrate the nested ‘select case’

'VB.Net program to demonstrate the 
'nested "select case"

Module Module1

    Sub Main()
        Dim choice1 As Integer = 2
        Dim choice2 As Single = 2.2

        Select Case choice1
            Case 1
                Select Case choice2
                    Case 1.1
                        Console.WriteLine("Option 1.1")
                    Case 1.2
                        Console.WriteLine("Option 1.2")
                    Case 1.3
                        Console.WriteLine("Option 1.3")
                End Select
            Case 2
                Select Case choice2
                    Case 2.1
                        Console.WriteLine("Option 2.1")
                    Case 2.2
                        Console.WriteLine("Option 2.2")
                    Case 2.3
                        Console.WriteLine("Option 2.3")
                End Select
            Case 3
                Select Case choice2
                    Case 3.1
                        Console.WriteLine("Option 3.1")
                    Case 3.2
                        Console.WriteLine("Option 3.2")
                    Case 2.3
                        Console.WriteLine("Option 3.3")
                End Select
            Case Else
                Console.WriteLine("Invalid choice")
        End Select
    End Sub
    
End Module

Output

Option 2.2
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply