Created
March 17, 2009 09:50
-
-
Save hogelog/80434 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
int sum_for() { | |
int x, result = 0; | |
for (x=0;x<1000;++x) { | |
result += x; | |
} | |
return result; | |
} | |
int sum_while() { | |
int x, result = 0; | |
x = 0; | |
while (x<1000) { | |
result += x; | |
++x; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment