Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NWD(){
- var a = prompt("Podaj pierwszą liczbę","");
- var b = prompt("Podaj drugą liczbę","");
- var c = a;
- var d = b;
- while (a!=b) {
- if (a<b) {
- b = b-a;
- } else {
- a = a-b;
- }
- }
- document.write("NWD liczb "+c+" i "+d+" jest liczba "+a);
- };
- NWD();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement