Created
November 22, 2015 17:56
-
-
Save philpoore/934e03e05ac5277b8205 to your computer and use it in GitHub Desktop.
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
Examples of loops in diffrent languages | |
Each example prints the numbers 0 --> 9 inclusive. | |
// Javascript | |
for (var i = 0; i < 10; i += 1){ | |
console.log(i); | |
} | |
// Java | |
for (int i = 0; i < 10; i += 1){ | |
System.out.println(i); | |
} | |
// c | |
int i; | |
for (i = 0; i < 10; i++){ | |
printf(i); | |
} | |
// c++ | |
for (int i = 0; i < 10; i++){ | |
cout << i << endl; | |
} | |
// python | |
for i in range(0, 10): | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment