Created
June 11, 2019 00:48
-
-
Save AminBusiness/5edea5dcb640026d0e3cb554c21d6a04 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/faquyis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
//FIZZBUZZ | |
//Write a program that prints all the numbers | |
//from 1 to 100 for multiples of 3 | |
function fizzBuzz() | |
{ | |
for(let i = 1; i <= 100; i++) | |
{ | |
if(i % 15 === 0) | |
{ | |
console.log('FizzBuzz') | |
} | |
else if(i % 3 === 0) | |
{ | |
console.log('Fizz') | |
} | |
else if(i % 5 === 0) | |
{ | |
console.log('Buzz') | |
} | |
else( | |
console.log(i) | |
) | |
} | |
} | |
const output = fizzBuzz(); | |
console.log(output); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">//FIZZBUZZ | |
//Write a program that prints all the numbers | |
//from 1 to 100 for multiples of 3 | |
function fizzBuzz() | |
{ | |
for(let i = 1; i <= 100; i++) | |
{ | |
if(i % 15 === 0) | |
{ | |
console.log('FizzBuzz') | |
} | |
else if(i % 3 === 0) | |
{ | |
console.log('Fizz') | |
} | |
else if(i % 5 === 0) | |
{ | |
console.log('Buzz') | |
} | |
else( | |
console.log(i) | |
) | |
} | |
} | |
const output = fizzBuzz(); | |
console.log(output); | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FIZZBUZZ | |
//Write a program that prints all the numbers | |
//from 1 to 100 for multiples of 3 | |
function fizzBuzz() | |
{ | |
for(let i = 1; i <= 100; i++) | |
{ | |
if(i % 15 === 0) | |
{ | |
console.log('FizzBuzz') | |
} | |
else if(i % 3 === 0) | |
{ | |
console.log('Fizz') | |
} | |
else if(i % 5 === 0) | |
{ | |
console.log('Buzz') | |
} | |
else( | |
console.log(i) | |
) | |
} | |
} | |
const output = fizzBuzz(); | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment