Vidyalelo
C# Programming · all questions

File Handling and Input Output in C Sharp
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

112

Questions

5/6

Page

Pick an option on a question to see the right answer and solution.

Which method in Console enables to read individual inputs directly from the keyboard in a non line buffered manner?

Select an option to see the answer and solution.

Select the objects of the class TextWriter which is/are not used to perform the write operations to the console?

Select an option to see the answer and solution.

Choose the methods provided by Console.Out and Console.Error?

Select an option to see the answer and solution.

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
    string h = "i lovelife";
    string h1 = new string(h.Reverse().ToArray());
    Console.WriteLine(h1);
    Console.ReadLine();
}

Select an option to see the answer and solution.

From which of these classes, the character based output stream class Stream Writer is derived?

Select an option to see the answer and solution.

Which among the following is used for storage of memory aspects?

Select an option to see the answer and solution.

Select the correct methodS provided by Console.In?

Select an option to see the answer and solution.

Which of the given stream methods provide access to the input console in C#.NET?

Select an option to see the answer and solution.

Select the namespace/namespaces which consists of methods like Length(), Indexer(), Append() for manipulating the strings.

Select an option to see the answer and solution.

The number of input methods defined by the stream method Console.In in C#.NET is?

Select an option to see the answer and solution.

Choose the object/objects defined by the Textwriter class.

Select an option to see the answer and solution.

Which of the following is a type of stream in C#?

Select an option to see the answer and solution.

The method used to write a single byte to an output stream?

Select an option to see the answer and solution.

Which of the following cannot further inspect the attribute that is once applied?

Select an option to see the answer and solution.

Select the correct statement about Attributes used in C#.NET?

Select an option to see the answer and solution.

In the given constructor declaration for character based file operation what does 'path' and 'bool specifies?
StreamWriter(string path, bool append)

Select an option to see the answer and solution.

Choose the stream class method which is used to close the connection?

Select an option to see the answer and solution.

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
    String a ="i love iostream";
    Console.WriteLine(a.IndexOf('i') + " " + a.IndexOf('e') + " " + a.LastIndexOf('i') + " " + a.LastIndexOf('e'));
    Console.ReadLine();
}

Select an option to see the answer and solution.

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 10, b = 0;
    int result;
    Console.Out.WriteLine("This will generate an exception.");
    try
    {
        result = a / b; // generate an exception
    }
    catch (DivideByZeroException exc)
    {
        Console.Error.WriteLine(exc.Message);
    }
    Console.ReadLine();
}

Select an option to see the answer and solution.

Which of these classes is used to read and write bytes in a file?

Select an option to see the answer and solution.