Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry Challenge C2 #2

Open
Tracked by #292
hum-dev opened this issue Aug 25, 2024 · 4 comments · May be fixed by #112
Open
Tracked by #292

Entry Challenge C2 #2

hum-dev opened this issue Aug 25, 2024 · 4 comments · May be fixed by #112
Labels
Challenge For Challenges

Comments

@hum-dev
Copy link
Collaborator

hum-dev commented Aug 25, 2024

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, print Buzz; and for numbers that are multiples of both 3 and 5, print FizzBuzz.

@hum-dev hum-dev added the Challenge For Challenges label Aug 26, 2024
@daviewisdm
Copy link

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)

@Jeremiah-o
Copy link

//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);

@gateremark
Copy link
Contributor

STOP WRITING YOUR SOLUTIONS IN THE ISSUES KINDLY.

Create a Fork; Work on the challenge; Then create a PR (Pull Request) with your solution(s).

  • Check the How to Submit section in the email you have received.

Thank you.

cc: @Jeremiah-o , @Angote433 , @daviewisdm

@Simon-Njoroge
Copy link

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);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Challenge For Challenges
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants