Java program to print reverse right-angled triangle of numbers

Java program to print reverse right-angled triangle of numbers. In the Java programming language, build a low-facing pattern application. This software will print the pattern with an asterisk at the bottom. In a pattern program for beginners in the Java programming language, print the asterisk downwards.

public class Main 
{ 
public static void main(String[] args) 
{ 
int rows=5; 
for (int i= rows-1; i>=0 ; i--) 
{ 
for (int j=0; j<=i; j++) 
{ 
System.out.print("*" + " "); 
} 
System.out.println(); 
} 
} 
} 

 

Output:

* * * * *                                                                                                                                                

* * * *                                                                                                                                                  

* * *                                                                                                                                                    

* *                                                                                                                                                      

What is triangle pattern program in java

Each small triangle is the same size as its respective small rectangle. To put it another way, our triangle is exactly half the length of the rectangle. If you wish to measure a triangle, simply multiply its base b by its height h and divide by two.

What is rows and columns in java

Rows are a horizontally aligned set of cells that create consistency. Columns are vertically aligned groups of cells that run from top to bottom. A row in a table or spreadsheet is a horizontal line of data, whereas a column is a vertical line of cells in a chart, table, or spreadsheet. Rows run from left to right across the board. Columns, on the other hand, are oriented from top to bottom.