WAP in Java to print:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answers
Answered by
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
1
Answer:
What is the question
Explanation:
Mark me as brainlist
Similar questions