import java.util.Scanner;
class CompleteDownPyramid2 
{
	public static void main(String[] args) 
	{
 	    System.out.print("Please Enter Pyramid size: ");
        Scanner read = new Scanner(System.in);
        int size = read.nextInt();
        for (int i = size; i >= 1; i--) {
            // for spacing
            for (int j = 1; j <= size - i; j++){     
				System.out.print(" ");            
			}         
			// left half of  pyramid        
			for (int k = i; k >= 1; k--){
                System.out.print( "*");
            }
            //  right half of  pyramid
            for (int l = 2; l <= i; l++) {             
				System.out.print("*" );
            }
            // next line
            System.out.println();
        }
	}
}

/*
=======Output========

Please Enter Pyramid size: 6

***********
 *********
  *******
   *****
    ***
     *


Leave a Reply

Your email address will not be published. Required fields are marked *