Java Program to print English Alphabets between two Alphabets

Description

Get two alphabets and print the alphabets lies between them.
Input:
D H
Ouput:
D E F G H

Solution

import java.util.*;
class Alies
{
    public static void main(String args[])
    {
        char i;
	char start,stop;
        Scanner sc=new Scanner(System.in);	
        System.out.println("Enter Two Alphabets:");
	start=sc.next().charAt(0);
        stop=sc.next().charAt(0);
	System.out.println("The Output Is:");
	for(i=start;i<=stop;i++)
	  {
		System.out.print(" "+i);
	  }
    }
}

Explanation

set variable as starting letter of given input

Print increament varible Till end of given string. 
Ramesh P Natarajan

Author - Ramesh P Natarajan

Learner, Professor, Technology Trainer, Software Developer and Content Marketer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Write to: admin@decodeschool.com





Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution