miércoles, 4 de noviembre de 2009

MUESTRA EL FACTORIAL DE UN NUMERO Y ADEMAS UN NOMBRE INGRESADO LETRA POR LETRA UTILIZANDO LA INSTRUCCION LEN(PARA EXTRAER EL TAMAÑO DE LA CADENA Y REA

'MUESTRA EL FACTORIAL DE UN NUMERO
PUBLIC SUB Main()
DIM nombre, res AS String
DIM f, l, i AS Integer
f = 1
FOR i = 2 TO 5
f = f * i
NEXT
PRINT "el factorial de 5 es ", f

'MUESTRA EL NOMBRE INGRESADO LETRA POR LETRA
PRINT "Ingrese nombre "
INPUT nombre
l = Len(nombre)
PRINT "\n"
PRINT "El resultado es:"
FOR i = 1 TO l
res = Mid(nombre, i, 1)
PRINT res
NEXT
END

No hay comentarios:

Publicar un comentario