Skip to content

Instantly share code, notes, and snippets.

@Aaron-CR
Created July 10, 2020 23:20
Show Gist options
  • Select an option

  • Save Aaron-CR/0be2d682e5c45037a27dfcc8fee96d5f to your computer and use it in GitHub Desktop.

Select an option

Save Aaron-CR/0be2d682e5c45037a27dfcc8fee96d5f to your computer and use it in GitHub Desktop.
Ejemplo utilizado en el vídeo de recursividad
SubAlgoritmo retorno <- Factorial( numero )
Definir retorno Como Entero
Si (numero == 0) Entonces
retorno <- 1
SiNo
retorno <- numero * factorial(numero - 1)
FinSi
FinSubAlgoritmo
Algoritmo Recursividad
Definir numero Como Entero
Definir resultado Como Entero
Escribir "Ingrese un numero para calcular el factorial"
Leer numero
resultado = Factorial(numero)
Escribir resultado
FinAlgoritmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment