Anda di halaman 1dari 1

adivinar Sub Main() Dim Dim Dim Dim Dim

numsecreto As Integer resp As String Random As New Random() cont As Integer num As Integer

cont = 0 MsgBox("Programa para Adivinar un Numero") numsecreto = Random.Next(1, 100) MsgBox("Acabo de pensar un Nmero Secreto, Intenta Adivinar cual es") While numsecreto <> Random.Next(1, 100) num = InputBox("ingrese la posible respuesta") cont = cont + 1 MsgBox("no es, intente otra vez") End While resp = InputBox("Quiere conocer el nmero") If resp = "si" Then MsgBox("El Nmero secreto era " & numsecreto) End If MsgBox("usted intento " & cont & " veces") If cont <= 3 Then MsgBox("bueno") Else If cont > 3 And cont <= 6 Then MsgBox("regular") Else MsgBox("malo") End If End If End Sub

Anda mungkin juga menyukai