Thursday 16 April 2015

Print the star in a right angle triangle

package star;

public class stars1 {


public static void main(String[] args) {
int row, stars;
   
     for ( row = 1 ; row <= 5 ; row++ )
     {
        for ( stars= 1 ; stars<= row ; stars++ )
        {
           System.out.print("*");
         
        }

        System.out.println();
     }
  }
}

No comments:

Post a Comment