Output:
Click Here For Java Online Compiler
Solution:
*** Star Pattern 12 *** ********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** **********
Click Here For Java Online Compiler
Solution:
/** * * @author Alee Ahmed Kolachi */ public class StarPattern12 { public static void main(String args[]) { int space = 0; System.out.println("*** Star Pattern 12 ***" + "\n"); for (int i = 5; i >= 1; i--) { //first part of row for (int j = i; j >= 1; j--) { System.out.print("*"); } //space for (int j = 1; j <= space; j++) { System.out.print(" "); } //second part of row for (int j = i; j >= 1; j--) { System.out.print("*"); } System.out.println(); space = space + 2; } space = 8; for (int i = 1; i <= 5; i++) { //first part of row for (int j = 1; j <= i; j++) { System.out.print("*"); } //space for (int j = 1; j <= space; j++) { System.out.print(" "); } //second part of row for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println(); space = space - 2; } } }
comment 1 comments:
more_vertnice article.thank you for sharing useful info.
29 August 2018 at 20:08visit
web programming tutorial
welookups
sentiment_satisfied Emoticon