Created
January 17, 2020 14:16
-
-
Save mamiwinsfall93/58c1ec5fc63fa9850fcee0fee0a10289 to your computer and use it in GitHub Desktop.
Even numbers
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
/* | |
Even numbers | |
Use a for loop to display even numbers from 1 to 100 inclusive. | |
Display each value on a new line | |
*/ | |
public class Solution { | |
public static void main(String[] args) throws Exception { | |
for (int i =2; i<=100;i=i+2){ | |
System.out.println(i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment