Here, we are reading number of rows, and according to the input diamond pattern will be printed.
Example:
Input:
Enter number of rows: 10
Output:
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*
Print diamond of stars in java
Output
Enter number of rows: 10 * *** ***** ******* ********* *********** ************* *************** ***************** ******************* ***************** *************** ************* *********** ********* ******* ***** *** *
need an explanation for this answer? contact us directly to get an explanation for this answer