Monday 23 March 2020

PRINTING NUMBERS AND LETTERS USING JAVA LANGUAGE

Q-10- What do each of the following print?
           a. System.out.println('b');
           b. System.out.println('b' + 'c');
           c. System.out.println((char) ('a' + 4));

INPUT :
public class NCM {

public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println('b');
System.out.println('b'+'c');
System.out.println((char) ('a'+4));
}


}

OUTPUT :
b
197

e

No comments:

Post a Comment