Skip to content

Commit

Permalink
Merge pull request mouredev#6476 from adaviladev/main
Browse files Browse the repository at this point in the history
Reto #0 - Javascript
  • Loading branch information
Roswell468 authored Apr 28, 2024
2 parents 23b70b1 + f06a232 commit 2afd84d
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// let number = 0;

// while (number < 100) {
// number++;
// if (number % 3 === 0 && number % 5 === 0) {
// console.log("fizzbuzz");
// } else if (number % 3 === 0) {
// console.log("fizz");
// } else if (number % 5 === 0) {
// console.log("buzz");
// } else {
// console.log(number);
// }
// }

const fizz = "fizz";
const buzz = "buzz";

for (let i = 1; i <= 100; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log(fizz + buzz);
} else if (i % 3 === 0) {
console.log(fizz);
} else if (i % 5 === 0) {
console.log(buzz);
} else {
console.log(i);
}
}

0 comments on commit 2afd84d

Please sign in to comment.