Computer Science, asked by srijansrivastav, 1 year ago

write a program in java to print this series.
1
21
321
4321
54321

Answers

Answered by Deepak1011dp
15
import java.util.Scanner;

 

public class Pattern {

 

    public static void printPattern(int n) {

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

            for (int j = i; j >= 1; j--) {

                System.out.print(j + " ");

            }

            System.out.println();

        }

    }

 

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter a number: ");

        int n = scanner.nextInt();

        printPattern(n);

    }

 

}



Answered by Lipsa24
30

Hey frnd ❤️❤️

hope helps yu✌️✌️✌️

pls refer to the attachment nd mark brainliest answer✌️✌️✌️✌️❤️

#Abhipsa❤️

Attachments:
Similar questions