/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
public class Main
{
public static void main(String [] args) {
int size=10;
int i, j;
//get row size of triangle
for(i=1;i<=size;i++) {
for(j=1;j<=size;j++) {
if((i+j)>size) { // add row * and space
System.out.print("*");
System.out.print(" ");
}
else // add row spaces, before printing stars
{
System.out.print(" ");
}
}
System.out.println();
}
}
}