java alphabet pattern using for loop | while loop | do while loop



java alphabet pattern using for loop | while loop | do while loop
/*java alphabet pattern using for loop*/
class Alphabets
{
   public static void main(String args[])
   {
      char ch;
      for( ch = 'a' ; ch <= 'z' ; ch++ )
         System.out.println(ch);
   }
}


/*java alphabet pattern using while loop*/
class Alphabets
{
   public static void main(String args[])
   {
char ch = 'a';

while (ch <= 'z') {
  System.out.println(ch);
  ch++;
}
}


/*java alphabet pattern using do while loop and Java Program to Print Alphabets in Upper and Lower Case */
class Alphabets
{
   public static void main(String args[])
   {
char ch = 'A';

do {
  System.out.println(ch);
  ch++;
} while (ch <= 'Z');
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics