Skip to content

Instantly share code, notes, and snippets.

@mamiwinsfall93
Created January 17, 2020 14:16
Show Gist options
  • Save mamiwinsfall93/58c1ec5fc63fa9850fcee0fee0a10289 to your computer and use it in GitHub Desktop.
Save mamiwinsfall93/58c1ec5fc63fa9850fcee0fee0a10289 to your computer and use it in GitHub Desktop.
Even numbers
/*
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