QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A ICSE2017-02E #7229

Question:

Write the output:
char ch = ‘F’;
int m = ch;
m=m+5;
System.out.println(m + ” ” + ch);

Answer:

ch = ‘F’
int m = ch; — ASCII value of ‘F’ i.e. 70 will be assigned to m
m = m + 5 = 70 + 5 = 75
System.out.println(m+ ” ” +ch); — 75 F
Output is
75 F