Q:

Java program to print uppercase and lowercase alphabets

0

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

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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 

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now