Computer Applications
Write a program in Java to input a character. Find and display the next 10th character in the ASCII table.
Java
Java Library Classes
188 Likes
Answer
import java.util.Scanner;
public class KboatTenthChar
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter a character: ");
char ch = in.next().charAt(0);
char nextCh = (char)(ch + 10);
System.out.println("Tenth character from "
+ ch + " is " + nextCh);
}
}
Variable Description Table
Program Explanation
Output

Answered By
88 Likes
Related Questions
Name the package that contains wrapper classes.
Write the prototype of a function check which takes an integer as an argument and returns a character.
Write a program in Java to input a character. Display next 5 characters.
Write a program in Java to generate all the alternate letters in the range of letters from A to Z.