You are on page 1of 2

//////If////////////

Dim edad As Integer hola


Dim licencia As Boolean
Console.WriteLine("Cual es tud edad? ")
edad = Console.ReadLine
Console.WriteLine("Posees licencia de conducir?, escribe True or False "
)
licencia = Console.ReadLine
If edad >= 18 AndAlso licencia = True Then
Console.WriteLine("Estas autorizado para conducir")
Else
Console.WriteLine("No estas autorizado para conducir")
End If
Console.ReadLine()
End Sub
Dim tp As Integer
Dim marca As String
Console.WriteLine("ingrese el total a pagar ")
tp = Console.ReadLine
Console.WriteLine("Incluye marca participante")
marca = Console.ReadLine
If tp > 300 OrElse marca = "si" Then
Console.WriteLine("tendra descuento")
End If
Console.Read()
End Sub
-------------while
Dim mynum As Integer
mynum = 25
While mynum < 100
mynum = mynum + 1
Console.WriteLine(mynum)
End While
Console.ReadLine()
Dim i, numero, tabla As Integer
i = 1
Console.WriteLine("Ingrese un numero ")
numero = Console.ReadLine
While i <= 10
tabla = numero * i
Console.WriteLine(numero & "x" & i & "=" & tabla)
i = i + 1
If i = 5 Then
Exit While
End If
End While
Console.Read()
///////////////

Imports System.IO
This imports the Input / Output namespace, which allows us to read and write fi
les.Below that, add:
Module Module4
Sub main()
Dim path = "c:\Users\User\Desktop\Ejercicio.txt"
Dim sr As New StreamReader(path)
Dim line = sr.ReadToEnd()
While line IsNot Nothing
Console.WriteLine(line)
Exit While
End While
Console.ReadLine()

You might also like