Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function obliczModul(liczba) {
- return (liczba >= 0) ? liczba : -liczba;
- }
- var naszaLiczba = prompt("Podaj liczbę", "");
- if (isNaN(naszaLiczba) || naszaLiczba=="")
- {
- document.write("To nie liczba ziomek")
- }
- else
- {
- alert("Wartość bezwzględna z liczby " + naszaLiczba +
- " to:" + obliczModul(naszaLiczba));
- obliczModul();
- document.write("<br>" + "Wartość bezwględna tej liczby to" + ' ' + naszaLiczba);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement