- If Statement
- Select Case
- For Next Loop/Exiting For Loop/Continue For
- Do Until Loop
- Do While Loop
If...Then...Else
If 條件1 [ Then ] 若條件1為真,會執行此處的陳述式 [ ElseIf 條件2 [ Then ] 若條件2為真,會執行此處的陳述式 ] [ Else [ 不符以上條件才執行此處的陳述式 ] ] End If
程式範例
Dim score As Integer = 0
Console.WriteLine("請輸入分數:")
score = Console.ReadLine()
If score >= 60 Then
Console.WriteLine("及格")
ElseIf score < 60 & score >= 40 Then
Console.WriteLine("活當")
Else
Console.WriteLine("死當")
End If