In this tutorial, we will go through alphabet pattern programs in java programming. Before that, you may go through the following topic in java.
Java Character Pattern Program
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
int rows, i, j, k;
Scanner sc = new Scanner(System.in);
System.out.print("Enter the no. of rows: ");
rows = sc.nextInt();
for (i = 0; i <= rows; i++)
{
int alphabet = 65;
for (j = 0; j < i; j++)
System.out.print(" ");
for (k = i; k <= rows; k++)
System.out.print((char)(alphabet + k)+" ");
System.out.println();
}
for (i = rows; i >= 0; i--)
{
int alphabet = 65;
for (j = 0; j < i; j++)
System.out.print(" ");
for (k = i; k <= rows; k++)
System.out.print((char)(alphabet + k)+" ");
System.out.println();
}
}
}
Output:
Enter the no. of rows: 5
A B C D E F
B C D E F
C D E F
D E F
E F
F
F
E F
D E F
C D E F
B C D E F
A B C D E F









