Print the star pattern in the oposite pyramid.

class Pyramid
  {
    public static void main(String args[])
     {
       int i,j,k;
       for(i=1;i<=5;i++)
         {
         for(j=1;j<=i;j++)
           {
             System.out.print("  ");
           }
          for(k=5;k>=i;k--)
           {
             System.out.print(" *");
           }
             for(k=4;k>=i;k--)
           {
             System.out.print(" *");
           }
          
          System.out.println("  ");
          System.out.println("  ");          
       }
     }
  }

2 comments:

  1. Any One give me this code in Java

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


    How to Write this program to Print Star Pattern in Java

    ReplyDelete
  2. Really Nice Post to Print Star Pattern in Java Yesterday I visit this blog and i was found lots of helpful information from your side thanks for sharing updated and New Technology related Post.

    ReplyDelete