Last active
March 21, 2016 03:17
-
-
Save CSaratakij/4fba2336c2830b1bcf3f to your computer and use it in GitHub Desktop.
My Num Flag Example
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
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