write a java program forming a pattern
12345
2345
345
45
5
Answers
Answered by
2
Answer:
12345
Explanation:
mark as brilliant
Answered by
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
Environmental Sciences,
4 months ago
Math,
4 months ago
Math,
4 months ago
Math,
9 months ago
Chemistry,
1 year ago