Created
July 10, 2020 23:20
-
-
Save Aaron-CR/0be2d682e5c45037a27dfcc8fee96d5f to your computer and use it in GitHub Desktop.
Ejemplo utilizado en el vídeo de recursividad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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