Advertisements
Advertisements
प्रश्न
Write a program in Java to input a character. Find and display the next 10th character in the ASCII table.
संक्षेप में उत्तर
उत्तर
import java.util.*;
public class Q1
{public static void main(String args[])
{ Scanner in = new Scanner(System.in);
char ch;
int x;
System.out.printIn("Enter the character");
ch = in.next().charAt(0);
x = (int) ch + 10;
System.out.println((char) x);
}}
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Library Classes - EXERCISES [पृष्ठ १७९]