Skip to content

Instantly share code, notes, and snippets.

@CSaratakij
Last active March 21, 2016 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CSaratakij/4fba2336c2830b1bcf3f to your computer and use it in GitHub Desktop.
Save CSaratakij/4fba2336c2830b1bcf3f to your computer and use it in GitHub Desktop.
My Num Flag Example
package exnumloopflag;
public class ExNumLoopFlag {
public static void main(String[] args) {
int maxNum = 6;
String space = "";
for (int i = maxNum; i > 0; i--) {
System.out.print(space);
for (int n = 1; n <= i; n++) {
System.out.print(n);
}
space += " ";
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment