41.
What will be the output of the following Java program if input given is 'abcqfghqbcd'?
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 != 'q');
    }
}

42.
What will be the output of the following Java 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!='\'');
    }
}

43.
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    { 
         StringBuffer c = new StringBuffer("Hello");
         System.out.println(c.length());
    }
}

48.
What will be the output of the following Java program if input given is "Hello stop World"?
class Input_Output 
{
    public static void main(String args[]) throws IOException
    {	 
        string str;
        BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
        do
        {
            str = (char) obj.readLine();
      System.out.print(str);
        } while(!str.equals("strong"));
    }
}

49.
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    { 
         StringBuffer c = new StringBuffer("Hello");
         StringBuffer c1 = new StringBuffer(" World");
         c.append(c1);
         System.out.println(c);
    }
}

50.
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    { 
       StringBuffer s1 = new StringBuffer("Hello");
       s1.setCharAt(1,x);
       System.out.println(s1);
    }
}