Ver ❯
Herramientas SEO
Tamaño del resultado:
668 x 574
×
Cambiar Orientacion
Cambiar tema, Oscuro/Luz
<!doctype html> <html> <body> <title>Ejercicio - Factorial de un número entero</title> <h2>Estructura for</h2> <script type="text/javascript"> var numero = prompt("Introduce un número y se mostrará su factorial"); var resultado = 1; for(var i=1; i<=numero; i++) { resultado *= i; } alert(resultado); </script> </body> </html>