Created
August 15, 2016 19:15
-
-
Save m-stafford/5655e473eb212bd3498658868d7254af 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
public class Counter { | |
public static void main(String[] args) { | |
int countFrom = 100; | |
int subBy = 1; | |
int iteration = 0; | |
int i = 0; | |
while (countFrom >= 0) { | |
if ((i + 1) % 10 == 0) { | |
iteration += 1; | |
} | |
System.out.println(countFrom); | |
countFrom = (countFrom - (subBy + iteration)); | |
i += 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment