Académique Documents
Professionnel Documents
Culture Documents
Sub Main()
Dim a, b As Integer
Dim operador As String
Dim v As Double
Select operador
Case "s"
v = a + b
Case "r"
v = a - b
Case "m"
v = a * b
Case "d"
v = a / b
End Select
______________EJEMPLO 2_____________
Module module3
Sub Main()
Next contador
'imprimimos la sumatoria
Console.WriteLine("la sumatoria de los numeros es : {0}", suma)
'insertamos esta linea para q no se cierre el programa
Console.ReadLine()
End Sub
End Module
_________________EJEMPLO 3____________________
Module module2
Sub Main()
Dim a, b, c, prom As Integer
Console.Write("ingrese un numero")
a = Console.ReadLine()
Console.WriteLine()
prom = (a + b + c) / 3
End Sub
End Module
_---------------------------------------------------------------------------_
Sub Main()
Dim A As Integer
Dim B As Integer
Dim Operacion As String
Dim R As Double
Dim Variable as Integer
Dim Opcion as string
variable = 1
End Select
Do variable = 1
Console.WriteLine("la variable vale " & variable)
Console.WriteLine("�Desea hacer otra operacion ?(si/no)")
opcion = Console.ReadLine
If opcion = "no" Then
variable = 0
Else
variable = 1
End If
Loop
Console.WriteLine("Gracias.")
Console.ReadLine()
End Sub
End Module
---------------------------------------------------------------------------
-------------***EJERCICIO***-----***LENGUAJ.PROGRAM.***--------------------
---------------------------------------------------------------------------
Module Module1
Sub Main()
Dim A As Integer
Dim B As Integer
Dim Operacion As String
Dim R As Double
Dim Variable As Integer
Dim Opcion As String
Variable = 1
End Select
Do While Variable = 1
Console.WriteLine("la variable vale {0}", Variable)
Console.WriteLine("�desea seguir ejecutando este programa?(1/2)")
Opcion = Console.ReadLine
If Opcion = 2 Then
Variable = 2
Else
Variable = 1
Console.WriteLine("Inserta el primer valor ")
A = Console.ReadLine
Console.WriteLine(" Inserta el segundo valor ")
B = Console.ReadLine
End Select
_--------------------------------------------------------------------------_
Module Module1
Sub Main()
Else
Console.WriteLine(" Pin incorrecto ")
Console.ReadLine()
End If
'**********************ORTIZ**********************'
End Sub
End Module