Last active
December 26, 2015 11:39
-
-
Save joeyv/7145221 to your computer and use it in GitHub Desktop.
Adds 1 - 100 inclusively
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
| class Sum { | |
| public static void main(String[] args) { | |
| int i = 0, sum = 0; | |
| // Loop adds numbers 1 = 100 | |
| while(i < 100){ | |
| i++; | |
| sum += i; | |
| } | |
| System.out.print (sum); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment