Hacer un programa o algoritmo que permita ingresar una frase y la imprime al revés.
Solución
- Entrada: hola
- Salida: aloh
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cad As String = "" Dim entrada As String Dim tam As Integer entrada = TextBox1.Text tam = entrada.Length Dim pal(tam - 1) As String For i As Integer = 0 To tam - 1 pal(i) = entrada.Substring(i, 1) Next i For j As Integer = (tam - 1) To 0 Step -1 cad = cad + pal(j) Next j TextBox2.Text = cad End Sub End Class
2 comentarios:
ok que bueno
Muy buen servicio, me aclararon el error que tenia
Publicar un comentario