Computer Science, asked by vidhi200447, 7 months ago


WAP in Java to print:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5​

Answers

Answered by vorapoonam9
2

Answer: HOW TO PRINT?

HERE IS YOUR ANSWER

Explanation:

/*program to print the following output

eg: 122333444455555666666......nth iteration

*/

import java.util.Scanner;

public class Program

{

   public static void main(String[] args)

   

   {

       Scanner s = new Scanner(System.in);

       System.out.println("Enter the n value: ");

       int n = s.nextInt();

       

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

       {

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

           {

               System.out.print(i);

           }

       }

   }

}

Answered by NAMAN1033
1

Answer:

What is the question

Explanation:

Mark me as brainlist

Similar questions