55 POINTS, IN JAVA
In this program, you need to make an upright tree that contains stars *. Your output should look like:
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *

Hint: You will need to create a variable that controls how far the * is from edge of the console. That variable should change size each iteration through the outer loop!

Respuesta :

public class JavaApplication82 {

   

   public static void main(String[] args) {

       

       for (int i = 1; i <= 9; i++){

           for (int w = 0; w < i; w++){

               System.out.print("*");

           }

           System.out.println("");

           

       }

   }

   

}

This works for me.