ExamVeda
Login
Home
Networking in C Sharp
?

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();
    }
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.