<!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>Ejercicios</title>
</head>
<body>
<h1>Numeros pares del 1-100</h1>
<script>
imprimir("Metodo FOR")
for(i=1;i<=100;i++){
if(i%2==0){
imprimir(i);
}
if(i==100){
imprimir("FIN");
}
}
imprimir("Metodo WHILE");
let num = 1;
while (num <= 100) {
if (num % 2 === 0) {
imprimir(num);
}
if (num === 100) {
imprimir('FIN');
}
num++;
}
function saltarLinea(){
document.write("<br>");
}
function imprimir(frase){
document.write(frase);
saltarLinea();
}
</script>
</body>
</html>