Computer Science, asked by gprinc50, 10 months ago

Write a program to print the following pattern in java:
1
23
345
4567
56789
//Thank you

Answers

Answered by Anonymous
15

hope it helps!!

#sumedhian ❤❤

Attachments:
Answered by samanwitapaul07
0

Answer:

class pt3

{

   void accept()

   {

       int k=1;

       for(int i=1; i<=5; i++){

           for(int j=1; j<i; j++){

               System.out.print(k);

               k++;

           }

           System.out.println();

       }

   }

   public static void main(String args[])

   {

       pt3 ob =new pt3();

       ob.accept();

   }

}

Output:

Attachments:
Similar questions