Last active
August 31, 2017 04:46
-
-
Save jraczak/196ad68ba15bb63d4add3320c6f09ff4 to your computer and use it in GitHub Desktop.
Sum of squares of 1-10
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
int sum = 0; | |
int counter = 1; | |
while (counter < 10) { | |
System.out.println("Counter is at " + counter); | |
sum += counter * counter; | |
counter++; | |
} | |
System.out.println("The sum of the squares of 1-10 is " + sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment