Last active
January 1, 2016 21:29
-
-
Save lcolladotor/8203492 to your computer and use it in GitHub Desktop.
pablo's 2013 gift code
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
## Initialization of j | |
j <- 0 | |
for(i in seq(from=1, to=10, by=1)) { | |
## Note that x %% y is | |
## x mod y | |
## Pre-evaluation of j | |
j <- j + i %% 2 | |
## Post-evaluation of j | |
## Code question 1 | |
if(i == 5) { | |
print(paste("When i = 5, | |
the value of j (post evaluation of j) is", j)) | |
} | |
} | |
## Code question 2? Final value of j | |
print(paste("The final value of j is", j)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment