Instantly share code, notes, and snippets.

Embed
What would you like to do?
Desafios do Code n' Bier de 01 agosto de 2012
function fizzbuzz(a, b) {
for (var i = a; i <= b; i++) {
if (i % 3 == 0 && i % 5 == 0) {
console.log("Fizzbuzz");
} else if (i % 5 == 0) {
console.log("Buzz");
} else if (i % 3 == 0) {
console.log("Fizz");
} else {
console.log(i);
}
}
}
fizzbuzz(1, 100);
function fibo(lim)
{
var x = 1, a = b = 0;
console.log(x);
while (x < lim)
{
b = x;
x+= a;
a = b;
console.log(x);
}
}
fibo(100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment