Star printing program in Java, pattern 1

Star printing program in Java, pattern 1 :



Code for this pattern:


public class test {

    public static void main(String[] args) {
        for(int i = 0; i < 10; i++){
            for(int j=i+1;j>0;j--){
                System.out.print("*");
        }
        System.out.println();
        }
    }
}

You can try this in C.

Related Post :

How to print Stars pattern in C                                             How to print Stars pattern in Java

                                                                                                                                        Next pattern

 

Star printing program in Java, pattern 1. How to print star in java and c programming. How to print star in java and c code. star printing code in java.