Home » JAVA Programming » Files and I/O » Question
  1. What is the output of this program if input given is ‘prstquvwxyz’?
    import java.util.*;
    import java.io.*;
    public class Main
    {
    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 != 'q');
    }
    }
    1. prstquvwxyz
    2. prstquv
    3. prstq
    4. quvwxyz
    5. None of these
Correct Option: C

prstq



Your comments will be displayed only after manual approval.