Sail E0 Webinar
Question


What is the output of this program if input given is "abc'def/'egh"?


class Input_Output {
public static void main(String args[]) throws IOException {
char c;
BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
do {
c = (char) obj.read();
System.out.print(c);
} while(c != '\'');
}
}
Options:
A .  abc'
B .  abcdef/'
C .  abc'def/'egh
D .  abcqfghq
Answer: Option A

`setminus`' is used for single quotes that is for representing ' .
Output:
$ javac Input_Output.java
$ java Input_Output
abc'




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers