Skip to content

Instantly share code, notes, and snippets.

@jraczak
Last active August 31, 2017 04:46
Show Gist options
  • Save jraczak/196ad68ba15bb63d4add3320c6f09ff4 to your computer and use it in GitHub Desktop.
Save jraczak/196ad68ba15bb63d4add3320c6f09ff4 to your computer and use it in GitHub Desktop.
Sum of squares of 1-10
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