Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body bgcolor="blue" name="kolor" >
- <input type=text id="l1"/>
- <input type=text id="l2"/>
- <input type=text id="l3"/>
- <br>
- <button onClick="silnia()"> SILNIA </button>
-                            
- <button onClick="iloczyn()"> ILOCZYN PARZYSTYCH </button>
-  
- <button onClick="wyswietl()"> WYSWIETL </button>
- <script>
- function silnia()
- {
- var wynik=1;;
- var lib = parseInt(document.getElementById("l1").value);
- for (lib;lib>0;lib--)
- while (lib > 0 )
- {
- wynik = wynik * lib;
- lib = lib - 1;
- }
- alert (wynik)
- };
- function iloczyn()
- {
- var a = parseInt(document.getElementById("l1").value);
- var b = parseInt(document.getElementById("l2").value);
- var c = parseInt(document.getElementById("l3").value);
- var ap=1;
- var bp=1;
- var cp=1;
- if (a%2==0)
- ap=a;
- if (b%2==0)
- bp=b;
- if (c%2==0)
- cp=c;
- alert(ap*bp*cp);
- };
- function wyswietl()
- {
- var a = parseInt(document.getElementById("l1").value);
- var b = parseInt(document.getElementById("l2").value);
- if (b>30)
- {
- b=30;
- };
- for (a;a<=b;a++)
- {
- document.write(a)+" ";
- }
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement