Write a java code to print a Alphabetic Pattern.


Source Code:-

import java.io.*;
public class Pattern
 {
    public static void main(String[] args)
    {
        System.out.println("** Printing the pattern... **");
        for (int i = 0; i < 4; i++)
        {
            int alphabet = 65;
            for (int j = i; j >= 0; j--)
            {
                System.out.print((char) (alphabet + j) + " ");
            }
            System.out.println();
        }
    }
}

Output :-

Comments

Popular posts from this blog

Write a Java code to input height (in inches) and convert it into feet and inches.

Design an AWT application to calculate the factorial of a number.

Design an AWT application to check whether the number entered in textbox is prime or not.