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

Fixed the code #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed the code
CAnderson97 committed Jan 14, 2019
commit b450376278071d5ab0c8ffa9e8a27e5f2000068e
7 changes: 5 additions & 2 deletions problem.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,10 @@ function fizzBuzz(){
//If divisible by 3 and 5, print fizzbuzz
//Else, print the number
for(i=1;i<=100;i++){
if(i % 3 === 0){
if(i % 3 == 0 && i % 5 == 0){
console.log("fizzbuzz");
}
else if(i % 3 === 0){
console.log("fizz");
}
else if(i % 5 === 0){
@@ -17,4 +20,4 @@ function fizzBuzz(){
}
}

fizzBuzz();
fizzBuzz();