Created
December 5, 2012 01:22
-
-
Save Sandrucola/4211107 to your computer and use it in GitHub Desktop.
suma los n números naturales pares
This file contains hidden or 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
var n = 5; | |
var resultado = 0; | |
for (var i =0; i <n*2; i=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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment