TI

Pertanyaan

Tolong dijawab ya....

1.       Berikan contoh sederhana penggunaan IF THEN ELSE
2.       Berikan contoh sederhana penggunaan SELECT CASE!

2 Jawaban

  • If Label1.caption < 5 Then
    MsgBox("Angka Kurang Dari 5")
    Else
    MsgBox("Angka Lebih Dari 5")
    End If

    Dim i as Integer
    Select i
    Case 1
     i = 1
    Case 2
     i = 3
    Case End
    Exit Sub
    End Select
  • If Label1.caption < 5 Then
    MsgBox("Angka Kurang Dari 5")
    Else
    MsgBox("Angka Lebih Dari 5")
    End If

    Dim i as Integer
    Select i
    Case 1
     i = 1
    Case 2
     i = 3
    Case End
    Exit Sub
    End Select

Pertanyaan Lainnya