Examveda

What will be the output of the following C# code?
class Program
{
    static void Main(string[] args)
    {
        int ch;
        HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.example.com");
        HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
        Stream istrm = resp.GetResponseStream();
        for (int i = 1 ;  ;i++)
        {
            ch = istrm.ReadByte();
            if (ch == -1) 
            break;
            Console.Write((char)ch);
            if ((i % 400) == 0)
            {
                Console.Write("\nPress Enter.");
                Console.ReadLine();
            }
        }
        resp.Close();
    }
}

A. html

B. text

C. html/text

D. text/html

Answer: Option D


This Question Belongs to C Sharp Programming >> Networking In C Sharp

Join The Discussion

Related Questions on Networking in C Sharp

What is the difference between TCP and UDP in networking?

A. TCP provides reliable, connection-oriented communication, while UDP provides unreliable, connectionless communication

B. TCP provides unreliable, connectionless communication, while UDP provides reliable, connection-oriented communication

C. TCP is faster than UDP

D. UDP is more secure than TCP