MarcinKrol

Zad 10 - JS

Nov 24th, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. const l1 = prompt('podaj liczbę całkowitą (1/2)') * 1;
  2. const l2 = prompt('podaj liczbę całkowitą (2/2)') * 1;
  3.  
  4. if (l1 === 0){
  5. alert('Nie dziel przez 0!');
  6. }
  7. else if (l2%l1 === 0){
  8. alert(`${l2} jest podzielna przez ${l1}`);
  9. console.log(`${l2} jest podzielna przez ${l1}`);
  10. }
  11. else{
  12. alert(`${l2} nie jest podzielna przez ${l1}`);
  13. console.log(`${l2} nie jest podzielna przez ${l1}`);
  14. }
Add Comment
Please, Sign In to add comment