Pattern 11

*

* #

*#*

*#*#

*#*#*

package Patterns;
class pattern13
{
public static void main()
    {
for(int i=1;i<=5;i++)
       {
         for(int j=1;j<=i;j++)
            {
              if(j%2!=0)
               {
                   System.out.print("*");
               }
              else
               {
                   System.out.print("#");
               }
            }

          System.out.println();
       }
}
}

Pattern 12

*****

 ****

  ***

   **

    *

package Patterns;
class pattern11
{
public static void main()
    {
for(int i=1;i<=5;i++)
        {
            for(int k=1;k<=(i-1);k++){
               System.out.print(" ");
                }
           for(int j=5;j>=i;j--)
            {
               System.out.print("*");
            }
            System.out.println();
    }
}
}

Pattern 13

54321

4321

321

21

1

package Patterns;
class pattern15
{
public static void main()
    {
for(int i=5;i>=1;i--)
        {
           int k=i;
           for(int j=1;j<=i;j++)
            {
             System.out.print(k);
              k--;
            }
         System.out.println();
    }
}
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here