Computer Science, asked by arjya2004, 1 year ago

how to print this type of pattern in Java ?
5
44
333
2222
1 1 1 1 1

Answers

Answered by Bond54132
2

the answer is:

class pattern2

{

   void main()

   {

       int c=1;

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

       {

           for(int j=1;j<=c;j++)

           {

               System.out.print(i);

           }

           System.out.println();

           c++;

       }

   }

}

Similar questions