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
}
}
}
}
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 Example In Java |
1 comments:
commentsHow to Write these pattern code
Reply#
###
#####
##
#
How to Write this program to Print Star Pattern in Java