Tuesday 21 April 2015

Print the star in the form of right angle triangle from right side

package star;

public class stars2 {


public static void main(String[] args) {
int i,j,k;
        for(i=0;i<5;i++)
        {
            for(j=1;j<5-i;j++)
            {
                System.out.print(" ");
            }
            for(k=0;k<=i;k++)
            {
            System.out.print("*");
            }
        System.out.print("\n");
    }

}
}

No comments:

Post a Comment