Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Pyramid Java

public class HelloWorld{

     public static void main(String []args){
    
        for(int x = 10; x > 0; x--){
            System.out.println("");
            for(int y = 0; y<x; y++){
                System.out.print(" ");
            }
            for(int z = 10; z>x; z--){
                System.out.print("*");
            }
            for(int k = 10; k>x; k--){
                System.out.print("*");
            }
        }
     }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.