Created
June 26, 2021 15:43
-
-
Save bijay-shrestha/1c0f2d2d15f92b2f59b8d7802bd8e272 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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