By Java Programming:-
Print the
given ontput.
1
22
333
444
55555
Answers
Answered by
2
Write a program to display the following pattern.
1
22
333
4444
55555
class Pattern
{
public static void main()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number of rows for the pattern: ");
int rows=sc.nextInt();
for(int i=1;I<=rows;i++)
{
for(int j=1;j<=I;j++)
System.out.print(i);
System.out.println();
}
}
}
1
12
123
1234
12345
----------------
55555
4444
333
22
1
----------------
1 0 1 0 1 0
1 0 2 0 3 0
1 0 1 0 1 0
1 0 2 0 3 0
----------------
54321
4321
321
21
1
Similar questions