Written by Sai Sandeep Thota on July 17, 2013 in Java > Programming

Java Program to Print Alphabets

GET ALERTS:

Get our Latest updates delivered to your mailbox!

This is just a tiny Java program to Print Alphabets from a to z. What we are doing here is just take a character variable ch and use it in the for loop. All we are doing is starting the for loop at a and iterating all through z. It prints all the alphabets between a and z. If you want to print the alphabets in Uppercase then we just use: A and Z in the for loop.

class alphabets
{
	public static void main(String args[])
	{
		System.out.println("Alphabets from A to Z are:");
		System.out.println("lowercase:");
		for(char ch='a';ch<='z';ch++)
			System.out.print(ch+" ");
		System.out.println();
		System.out.println("UPPERCASE:");
		for(char ch='A';ch<='Z';ch++)
			System.out.print(ch+" ");
	}
}

Output:
Java Program to Print Alphabets

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: