PUBLIC SUB Main()
DIM f, i, l, t, n AS Integer
DIM factor AS Class1
factor = NEW Class1
PRINT "INGRESE UN NUMERO"
INPUT n
factor.poneroperador(n)
factor.cubo(n)
PRINT "el factorial es", factor.fac()
एंड
CLASE1
PUBLIC SUB fac() AS Integer
DIM i, f AS Integer
f = 1
FOR i = 1 TO operador1
f = f * i
NEXT
RETURN f
END
PUBLIC SUB poneroperador(numero AS Integer)
operador1 = numero
Eनदीफ़
PUBLIC FUNCTION cubo(num AS Integer)
DIM f, l, i, e, cb, acu AS Integer
f = 1
FOR i = 2 TO num
f = f * i
NEXT
cb = f
acu = 1
FOR e = 1 TO 3
acu = acu * cb
NEXT
PRINT "el cubo del numero ingresado es ", acu
END
0 comentarios:
Publicar un comentario