Sunday, 5 April 2020

Program: print next 5 five character of an input character

import java.util.Scanner;
public class ATS
{
public static void main()
{
Scanner in = new Scanner(System.in);
System.out.print("Enter a character: ");
char ch = in.next().charAt(0);
System.out.println("Next 5 characters from " + ch + " are:");
for (int i = 1; i <= 5; i++)
System.out.println(++ch);       
   
}
}

No comments:

Post a Comment