JAVA - How To Create A Parallelogram Star Program In Java

JAVA - How To Create A Program To Print Parallelogram Star Program In Java

                                                                                                                                                     

In This Java Code We Will See How To Make A Program To Print A Parallelogram Using For Loop In Java Programming Language.

Source Code:

package javaapp;
public class Woirk {
    
    public static void main(String[] args){

        //loop for 10 lines
        for(int i = 0; i < 10; i++){
            
            //loop for 40 stars
            for(int j = 0; j < 40; j++){
                System.out.print("*");
            }
            
             System.out.println();
             
             //loop for spaces
             for(int l = 0; l <= i; l++){
                System.out.print("  ");//two space
            }
        }
    }

}

//////////OUTPUT:
Parallelogram Star In Java
Parallelogram Star Example In Java




Share this

Related Posts

Previous
Next Post »

1 comments:

comments
24 octobre 2017 à 20:50 delete

How to Write these pattern code
#
###
#####
##
#


How to Write this program to Print Star Pattern in Java

Reply
avatar