Skip to content

Instantly share code, notes, and snippets.

@wohhie
Created September 6, 2016 07:17
Show Gist options
  • Save wohhie/c20d32891460659e9d59d09fa7cdcfe3 to your computer and use it in GitHub Desktop.
Save wohhie/c20d32891460659e9d59d09fa7cdcfe3 to your computer and use it in GitHub Desktop.
Print 0 to 10 and then print 10 to 0
package javatest;
/**
*
* @author tousifosman
*/
public class JavaTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
for(int i = 0, j = 0; i >= 0; i = i + 1 - 2 * (j/10), j++)
System.out.println(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment