Output Writing – Implicit conversion – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2017-02E #JAVA#7229    siteicon   siteicon  

Problem Statement - Output Writing – Implicit conversion

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

Solution

TC++ #7229

Run Output

75F

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


Share

CSKC| Created: 15-Apr-2019 | Updated: 28-Nov-2019|ICSE2017






Back