Computer Science, asked by ramakrishnapavu, 1 year ago

WRITE A JAVA PROGRAM FOR BELOW THIS
1
12
123
1234
12345

Answers

Answered by maryjessicka
3
import java.io.IOException;  import java.io.InputStreamReader;     public class NumberSeries  {   public static void main(String[] args) {          for (int i = 1; i <= 5; i++)             {                 for (int j = 1; j <= i; j++)                 {                     System.out.println(j);                 }                 System.out.println(“\n”);             }                                  } }



Answered by atrs7391
0

Easiest program:

package com.company;  

public class Main {

   public static void main(String[] args) {

       int s = 0;

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

           s = s*10+i;

           System.out.println(s);

       }

   }

}

Similar questions