Skip to content

Instantly share code, notes, and snippets.

@ufebri
Created March 16, 2020 05:51
Show Gist options
  • Save ufebri/36c814c137ba535e901e7ac6e82f12ff to your computer and use it in GitHub Desktop.
Save ufebri/36c814c137ba535e901e7ac6e82f12ff to your computer and use it in GitHub Desktop.
public class PiramidCounter {
public static void main(String[] args) {
showPiramidCounter(10);
}
private static void showPiramidCounter(int n) {
for (int i = 1; i <= n; ++i) {
for (int o = 1; o <= i; ++o) {
System.out.print(o + " ");
}
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment