Computer Science, asked by mayuresh8881, 11 months ago

Print the following in java -
1
121
12321
1234321
12321

Answers

Answered by gurukulamdivya
5

Answer:

class pattern_E

{

  public static void pattern(int no)

  {

      int n=1;

   for(int p=1;p<=no;p++)

   {

       for (int i=no;i>=1;i--)

      {

          System.out.print(" ");  

       }

       System.out.println("");

       for(int m=1;m<=p;m++)

       {

           System.out.print(m);

       }

             for(int y=p-1;y>=1;y--)

       {

           System.out.print(y);

       }

      System.out.println("");

   }

   }

}

Similar questions