Advertisement
JakubJaneczek

z10

Nov 27th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var x=prompt("Podaj liczbe a");
  3. var y=prompt("Podaj liczbe b");
  4. x=parseInt(x);
  5. y=parseInt(y);
  6. if(x==0)
  7. {
  8.     document.write("Nie da się dzielić przez 0");
  9. }
  10. else
  11. {
  12.     if(y%x==0)
  13.     {
  14.         document.write("Liczba b: "+y+"dzieli się przez liczbe a: "+x)
  15.     }
  16.     else
  17.     {
  18.         document.write("Liczba b: "+y+" nie jest podzielna przez liczbe a: "+x);
  19.         }
  20. }
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement