In this tutorial, we will write a java program to display the reverse right triangle pattern using the alphabet. These are character pattern programs in java. Before that, you may go through the following topic in java.
The program below takes the user input from the user for the number of rows and displays the reverse right triangle character pattern in various character orders.
This program can also be called the inverted half pyramid in java or Floyd’s triangle alphabet pattern in java.
Reverse right angled triangle pattern
public class Main
public static void main(String args)
int rows, i, j;
int ch = 64;
Scanner sc = new Scanner(System.in);
System.out.print("Enter the no. of rows: ");
rows = sc.nextInt();
for (i = 1; i <= rows; i++)
for (j = rows; j >= i; j--)
System.out.print((char)(j + ch));
Enter the no. of rows: 7