Computer Science, asked by kushagradivyamp, 12 hours ago

write a Java program to print the following series :-. - 1 - 12 - 123
1234
12345​

Answers

Answered by singhkhushdeep100
1

Answer:

public class KboatPattern

{

public static void main(String[] args) {

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

for (int j = 4; j >= i; j--)

System.out.print(" ");

for (int k = 1; k <= i; k++)

System.out.print(k);

System.out.println();

}

}

}

OUTPUT

BlueJ output of Write a program in Java to display the following pattern: 1 12 123 1234 12345

Answered by atrs7391
1

class pattern {

 public static void main(String[] args) {

   int counter = 0;

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

     counter = counter*10+i;

     System.out.println(counter);

   }

 }

}

Similar questions