2
respuestas

Edades 2

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>programa</h1>

    <script>
      function saltarLinea() {
        document.write("<br><br><br><hr><br><br>");
      }

      function imprimir(frase) {
        document.write("<big>" + frase + "</big>");
        saltarLinea();
      }

      var anho = 2025;

      imprimir("hola amigos");

      // este codigo calcula las edades de Juan, Pedro y Carlos

      imprimir("Juan tiene: " + (anho - 2000) + " años");

      imprimir("Pedro tiene: " + (anho - 1995) + " años");

      anho = 2030;

      imprimir("Carlos tiene: " + (anho - 2005) + " años");
    </script>
  </body>
</html>
2 respuestas

Excelente. a seguir con el curso

Gracias. Vamos por mas!!