Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ageFirst = prompt('Podaj wiek pierwszej osoby:') * 1;
- const ageSecond = prompt('Podaj wiek drugiej osoby:') * 1;
- if (ageFirst > 100 && ageSecond > 100){
- alert(`Gratulacje! Przeżyliście ${ageFirst} i ${ageSecond} lat!`)
- }
- else if (ageFirst > ageSecond){
- document.write(`Osoba pierwsza jest starsza niż osoba druga o ${ageFirst - ageSecond} lat`);
- }
- else if (ageSecond > ageFirst){
- document.write(`Osoba druga jest starsza niż osoba pierwsza o ${ageSecond - ageFirst} lat`);
- }
Add Comment
Please, Sign In to add comment