Skip to content

Instantly share code, notes, and snippets.

@bijay-shrestha
Created June 26, 2021 15:43
Show Gist options
  • Save bijay-shrestha/1c0f2d2d15f92b2f59b8d7802bd8e272 to your computer and use it in GitHub Desktop.
Save bijay-shrestha/1c0f2d2d15f92b2f59b8d7802bd8e272 to your computer and use it in GitHub Desktop.
/**
* Print Triangle of Ones.
*/
package com.basic.practice;
public class TriangleOfOne {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("1");
}
System.out.println("");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment