Star printing program in Java, pattern 3

Star printing program in Java, pattern 3 :



Code for this pattern :


public class test {

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

Try this in C.

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