Computer Science, asked by djohn33371, 3 months ago

char c=’B’; int i=(int)c+32; System.out.println((char)i);​

Answers

Answered by BrainlyProgrammer
3

Answer:

QUESTION:-

  • char c=’B’; int i=(int)c+32; System.out.println((char)i);

OUTPUT:-

b

EXPLANATION:-

See, int(Acii code) of B is 66

so i=66+32=98

now, char of i is b(Acii of b is 98)

Answered by anindyaadhikari13
1

Question:-

  • Give the output of the following code.

Working Out:-

Given code,

char c=’B’;

int i=(int)c+32;

System.out.println((char)i);

Here, c='B';

ASCII value of B is 66

So, i=66+32=98

Now,

(char)i='b'

So, the output is:- b.

Output:-

b

Similar questions