Created
July 4, 2021 14:09
-
-
Save bijay-shrestha/1e2d52bd3899f1415f0e1d5504ca448f to your computer and use it in GitHub Desktop.
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
/** | |
* | |
* Print numbered Flag | |
* 1 | |
* 2 3 | |
* 4 5 6 | |
* 7 8 9 10 | |
* 11 12 13 14 15 | |
* | |
*/ | |
package com.basic.practice; | |
public class NumberedFlag { | |
public static void main(String[] args) { | |
int num = 1; | |
for (int i = 0; i < 5; i++) { | |
for (int j = 0; j <= i; j++) { | |
System.out.print(num + " "); | |
num++; | |
} | |
System.out.println(""); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment