Ejercicio1.js 340 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
function primos() {
    let esPrimo = true;
    for(let i=100;i>1;i--){
        for(let j = 2;j<i;j++){
            if(i%j == 0){
                esPrimo = false;
                break;
            }
        }
        if(esPrimo){
            console.log("Primo: "+i);
        }else{
            esPrimo = true;
        }
    }
}

primos();