Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <script>
  2. function obliczModul(liczba) {
  3. return (liczba >= 0) ? liczba : -liczba;
  4. }
  5. var naszaLiczba = prompt("Podaj liczbę", "");
  6. if (isNaN(naszaLiczba) || naszaLiczba=="")
  7. {
  8. document.write("To nie liczba ziomek")
  9. }
  10.  
  11. else
  12. {
  13. alert("Wartość bezwzględna z liczby " + naszaLiczba +
  14. " to:" + obliczModul(naszaLiczba));
  15. obliczModul();
  16. document.write("<br>" + "Wartość bezwględna tej liczby to" + ' ' + naszaLiczba);
  17. }
  18.  
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement