Print Right Angle Triagle in Java

Below prints right angle triangle.

public class PrintRightAngleTriangle {
    public static void main(String[] args) {       
        for(int i=0; i<=10 ; i++){
            for(int j=0;j<=i;j++){
                System.out.print("* ");
            }
            System.out.println();
        }
    }
}


Output:
--------
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
* * * * * * * * * * * 

Comments

Popular posts from this blog

Oracle OIM - Search and Update Organization using java API

BEA-000362 Server failed. Reason: [Management:141268]Parsing Failure in config.xml

oracle.jbo.InvalidOperException: JBO-25221