Computer Science, asked by riteshjaiswal0511, 9 months ago

write a java program forming a pattern
12345
2345
345
45
5​

Answers

Answered by Anonymous
2

Answer:

12345

Explanation:

mark as brilliant

Answered by shouryabhardwaj2806
1

Hi here is your program,

import java.util.Scanner;

public class Pattern {

   public static void main(String[] args) {

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter n: ");

       int n = scanner.nextInt();

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

           for (int j = i; j <= n; j++) {

              System.out.println(j);

           }

           

       }

   }

Output:

12345

2345

345

45

5

Thankyou for the wonderful question

Similar questions