write a program to print pattern
1 22 333 4444 55555
Answers
Answered by
9
Answer:
import java.util.* ;
public class GenerateTriangle
{
public static void Triangle(int n)
{
for (int i = 1 ; i < = n ; i++ )
{
for (int j = 1 ; j < = i ; j++ )
{
System.out.print(" " + i) ;
System.out.println( ) ;
}
}
}
Nested Loop:
A loop inside body of another loop is called nested loop.
A nested loop is used when functioning of a loop is to be repeated a number of times.
Answered by
23
Answer:
See this.
Explanation:
Attachments:
Similar questions
Math,
5 months ago
Computer Science,
5 months ago
Social Sciences,
11 months ago
Chemistry,
11 months ago
Math,
1 year ago