TO PRINT PYRAMID TYPE 2

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



class Pattern6
{
public static void main(String[] args)
{ boolean k;
for(int i=1;i<=5;i++)
{    k=true ;
for(int j=1;j<=9;j++)
            {  
       
  if(j>=6-i && j <= 4+i && k){
System.out.print("*");
k=false;}
    else{
System.out.print(" ");
k=true;}
}
System.out.println();
}
}
}

Comments

Popular posts from this blog

Problem Statement Of Real Estate Use Cases

Problem Statement Of Bank Marketing analysis

Hadoop