Advertisement
WiktoriaRatajczyk

JavaScript1-10

Nov 23rd, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const podzielna1 = prompt ("Podaj pierwszą (mniejszą) liczbę");
  2.  
  3. if (podzielna1 == 0)
  4. {
  5.         document.write ("Nie mozna dzielić przez 0");
  6. }
  7.  
  8. else
  9. {
  10.     const podzielna2 = prompt ("Podaj drugą (większą) liczbę");
  11.    
  12.     if (podzielna2%podzielna1 == 0)
  13.     {
  14.         document.write ("Twoje liczby są podzielne");
  15.     }
  16.    
  17.     else
  18.     {
  19.         document.write ("Twoje liczby nie są podzielne");
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement