You are on page 1of 2

Ejercicio 2

Sub Main()
Dim x, y, m, t, n, c, d As String

m = "dia"
t = "tarde"
n = "noche"
c = "caballero"
d = "dama"

Console.WriteLine("introduzca el momento del dia")


x = Console.ReadLine()

If x = "m" Then
Console.WriteLine("dia")
ElseIf x = "t" Then
Console.WriteLine("tarde")
ElseIf x = "n" Then
Console.WriteLine("noche")
End If

Console.WriteLine("introduzca su parentezco")
y = Console.ReadLine()
If y = "c" Then
Console.WriteLine("caballero")

Console.WriteLine("buenos " & x & ", " & c)


ElseIf y = "d" Then
Console.WriteLine("dama")
Console.WriteLine("buenos " & x & ", " & d)

End If

Console.ReadKey()
End Sub

Ejercicio 1
Sub Main()
Dim n As Integer
Console.WriteLine("introduzca un numero")
n = Console.ReadLine()

For i As Integer = n To n Step 1


Console.WriteLine("cuantos asteriscos desea imprimir " & i)
Next

Console.ReadKey()
End Sub

You might also like