Skip to content

Instantly share code, notes, and snippets.

@massimilianop7
Created December 5, 2012 09:25
Show Gist options
  • Save massimilianop7/4214231 to your computer and use it in GitHub Desktop.
Save massimilianop7/4214231 to your computer and use it in GitHub Desktop.
funcion que sume los n numeros pares
var n = 6;
var resultado = 0;
for(var i=0; i<=n; i+=2) {
console.log ("el valor de i es"+i);
console.log ("el valor de resultado es"+resultado);
resultado = resultado+i;
console.log ("el valor de resultado + i es"+resultado);
}
console.log(resultado);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment