Half Pyramid Pattern Program In Java Language

 class Test2

{
    public static void main(String args[])
    {
        int n=5;
        for(int i=n; i>=1; i--){
            for(int j=1; j<=i; j++){
                System.out.print(j);
            }
            System.out.println();
        }
    }
}

OUTPUT:

12345 1234 123 12 1

Comments

Popular posts from this blog

Write A C Program To Delete A Single Element From An Array

Evolution of Computer Devices