ejercicio1.html 1.82 KB
Newer Older
nicodev77 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<html>
    <head>
        <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
        <meta content="utf-8" http-equiv="encoding">
    </head>
    <body>
        
        <script>
            function suma(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = x+y;
                console.log("la suma de los numeros aleatorios",+x,"e", +y, "es "+c);
            }
            function resta(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = x-y;
                console.log("la resta de los numeros aleatorios",+x,"e", +y, "es "+c);
            }
            function multiplicacion(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = x*y;
                console.log("la multiplicacion de los numeros aleatorios",+x,"e", +y, "es "+c);
            }
            function division(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = x/y;
                console.log("la division de los numeros aleatorios",+x,"e", +y, "es "+c);
            }
            function potencia(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = Math.pow(x,y);
                console.log("el valor de x",+x,"elevado a la potencia",+y,"es"+c);
            }
            function resto(){
                var x = Math.random()+100;
                var y = Math.random()+50;
                var c = x%y
                console.log("el resto de x",+x,"e",+y,"es"+c);
            }

            suma();
            resta();
            multiplicacion();
            division();
            potencia();
            resto();
            
        </script>
    </body>
</html>