title: beginner java - printing a right triangle backwards
body: <p>last time i was on here, the only question i needed help with in my computer science homework involved making a right triangle on 100 lines, here was the code for that:</p>
  
  <pre><code>    public class PrintTriangle {
     public static void main(String[] args) {
        // Print a right triangle made up of *
        // starting at 100 and ending with 1
           int i = 100;
           while (i &gt; 0) {
             for (int j = 0; j &lt; i; j++)
             System.out.print("*");
             System.out.println();
           i--;
           }
     }
  }
  </code></pre>
  
  <p>well now he's asked us to do the inverse. here's the actual question:</p>
  
  <blockquote>
    <p>"Write a program that will draw a right triangle of 100 lines in the
    following  shape: The first line, print 100 '<em>', the second line, 99
    '</em>’... the last line,  only one '*'. Using for loop for this problem.
    Name the program as  PrintTriangle.java"</p>
  </blockquote>
  
  <pre><code> *****
    ****
     ***
      **
       *
  </code></pre>
  
  <p>i'm sure it's something simple but everything i've tried up to this point has flopped or only created 1 space at a time. any suggestions or help would be greatly appreciated! thank you in advance!</p>