Star printing program in Java, pattern 2

Java is one of the very powerful programming languages. In this post, we are going to learn how to program star printing shape in java. 

Why we need to learn different star printing patterns? 

well, programming is all about applying logic. Those star printing projects help a learner programmer to learn the basic logical part of programming. So let's get into it and try to learn how to print star pattern in the java programming language. This is the 2nd-star pattern shape of out star printing program series.

 Star printing program in Java, pattern 2 : We have to program this following shape in java programming.



Let's have a look in the coding section for this star printing pattern in java.

Code for this pattern : 


public class test {

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

You can also try this same star printing pattern in the C programming language.
Happy coding.

Related post :

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

Previous pattern                                                                                                         Next pattern



0/Post a Comment/Comments