Output:
Click Here For Java Online Compiler
Solution:
*** Star Pattern 16 *** * * * * * * * * * * * * * * * *
Click Here For Java Online Compiler
Solution:
/** * * @author Alee Ahmed Kolachi */ public class StarPattern16 { public static void main(String[] args) { int noOfRows = 6; int midRow = (noOfRows) / 2; int row = 1; System.out.println("*** Star Pattern 16 ***" + "\n"); for (int i = midRow; i > 0; i--) { for (int j = 1; j <= i; j++) { System.out.print(" "); } for (int j = 1; j <= row; j++) { System.out.print("* "); } System.out.println(); row++; } //Printing lower half of the diamond for (int i = 0; i <= midRow; i++) { for (int j = 1; j <= i; j++) { System.out.print(" "); } for (int j = row; j > 0; j--) { System.out.print("* "); } System.out.println(); row--; } } }
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