VB Nested If Code For Grading The Result - Vb.net

How to use nested if code using VB.net?

Snippet Code

Rate this page :
  [ 0 votes]

The simple vb nested if else code is used to select a statement for execution based on the condition. The sample vb nested code for grading the result is given below.

Imports System Public Module Module1 Public Sub Main() Dim score As Integer = 92 If (score < 50) Then Console.WriteLine("Failed") Else If(score>=50 And score<=70) Then Console.WriteLine("Grade C") Else If(score>=70 And score<=90) Then Console.WriteLine("Grade B") Else Console.WriteLine("Grade A") End If End Sub End Module


Ask Questions

Ask Question