ADVERTISEMENT
ADVERTISEMENT

Java program to print uppercase and lowercase alphabets

In this java program, we are going to print uppercase and lowercase alphabets from A to Z and a to z using loop, it’s a very simple program demonstrating use of lopping with alphabets as loop counter.
Submitted by IncludeHelp, on November 02, 2017

Example:

Uppercase alphabets:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
Lowercase alphabets:
a b c d e f g h i j k l m n o p q r s t u v w x y z

Program to print alphabets in java

public class PrintAlphabets 
{
	public static void main(String args[])
	{
		char ch;

		//printing uppercase alphabets 
		System.out.println("Uppercase alphabets:");
		for(ch='A';ch<='Z';ch++)
			System.out.print(ch + " ");

		//printing new line
		System.out.println("");

		//printing lowercase alphabets 
		System.out.println("Lowercase alphabets:");
		for(ch='a';ch<='z';ch++)
			System.out.print(ch + " ");		
	}
}

Output

Uppercase alphabets:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
Lowercase alphabets:
a b c d e f g h i j k l m n o p q r s t u v w x y z 

Java Basic Programs »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.