Computer Science, asked by mehuleedas, 7 months ago

By Java Programming:-

Print the
given ontput.
1
22
333
444
55555​

Answers

Answered by anindyaadhikari13
2

\star\:\:\:\bf\large\underline\blue{Question:-}

Write a program to display the following pattern.

1

22

333

4444

55555

\star\:\:\:\bf\large\underline\blue{Source\:Code:-}

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();

}

}

}

\star\:\:\:\bf\large\underline\blue{Similar\:Patterns:-}

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