Open hum-dev opened 2 months ago
for i in range(1, 101): if i % 3 == 0 and i % 5 == 0: print("FizzBuzz") elif i % 3 == 0: print("Fizz") elif i % 5 == 0: print("Buzz") else: print(i)
//javascriprt//
const final=[]; const num=1; while (count<=100){ if (num%3==0 && num%5==0){ final.push("FIZZBUZZ"); } else if(num%3==0){ final.push("FIZZ"); } else if (num%5==0){ final.push("BUZZ"); } else{ final.push(num); } num++; } console.log(final);
Create a Fork; Work on the challenge; Then create a PR (Pull Request) with your solution(s).
Thank you.
cc: @Jeremiah-o , @Angote433 , @daviewisdm
for (let i = 1; i <= 100; i++) { if (i % 3 === 0 && i % 5 === 0) { console.log("FizzBuzz"); } else if (i % 3 === 0) { console.log("Fizz"); } else if (i % 5 === 0) { console.log("Buzz"); } else { console.log(i); } }
Entry Challenge C2
FizzBuzz
Write a program that prints the numbers from 1 to 100. For multiples of 3, print
Fizz
; for multiples of 5, printBuzz
; and for numbers that are multiples of both 3 and 5, printFizzBuzz
.