Output:
Click Here For Java Online Compiler
Solution:
Enter the number of rows: 8 8 8 7 8 7 6 8 7 6 5 8 7 6 5 4 8 7 6 5 4 3 8 7 6 5 4 3 2 8 7 6 5 4 3 2 1
Click Here For Java Online Compiler
Solution:
import java.util.Scanner; class NumberPattern7 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the number of rows: "); int base = scanner.nextInt(); System.out.println(); for (int j = base; j > 0; j--) { for (int i = base; i >= j; i--) { System.out.print(i + " "); } System.out.println(); } } }
comment 1 comments:
more_vertnice article.thank you for sharing useful info.
29 August 2018 at 20:12visit
web programming tutorial
welookups
sentiment_satisfied Emoticon