Choose Your Language

Thursday, 11 July 2013

Java program to print alphabets in capital and small letters

public class DisplayAlphabets {
    public static void main(String abc[])
   {
      char alphabets;

       for( alphabets = 'a' ; alphabets <= 'z' ; alphabets++ )
       {
         System.out.print(alphabets+" ");
       }
       System.out.println("");
       for( alphabets = 'A' ; alphabets <= 'Z' ; alphabets++ )
       {
         System.out.print(alphabets+" ");
       }
   }  
  
}

output:
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 
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

No comments:

Post a Comment