Advertisements
Advertisements
Question
Write the value of n after execution:
char ch = 'd';
int n = ch + 5;Advertisements
Solution
105
Explanation:
ASCII code of 'd' is 100.
∴ 100 + 5 = 105
APPEARS IN
RELATED QUESTIONS
Write the memory capacity (storage size) of short and float data type in bytes.
Differentiate between if else if and switch-case statements.
State the data type and value of res after the following is executed :
char ch = ‘9’;
res = Character. isDigit(ch)
Write a difference between the functions isUpperCase() and toUpperCase().
Write the return data type of the following function:
log( )
State one difference between the floating point literals float and double.
What will be the output when the following code segment is executed?
String s = “1001”;
int x = Integer. valueOf(s);
double y = Double.valueOf(s);
System.out.println(“x=”+x);
System.out.println(“y=”+y);
Give the output of the following Character class method:
Character.isLetterOrDigit('W')What is the method to check whether a character is a letter or digit?
The method to convert a lowercase character to uppercase is ______.
