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

3/6

Page

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

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
    StringBuilder sb = new StringBuilder("hello world");
    sb.Insert(6, "good");
    Console.WriteLine(sb);
    Console.ReadLine();
}

Select an option to see the answer and solution.

Choose the output returned when read() reads the character from the console?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output for following input from the console as a character?
static void Main(string[] args)
{
    Console.WriteLine("what is your name?");
    char s;
    s = Convert.ToChar(Console.ReadLine());
    Console.WriteLine("how are you: "+s);
    Console.Read();
}

Select an option to see the answer and solution.

Which of the following statement is correct?

Select an option to see the answer and solution.

Choose the object of TextReader class.

Select an option to see the answer and solution.

Which of the following is the correct statement about inspecting an attribute in C#.NET?

Select an option to see the answer and solution.

Choose the output returned when an error condition is generated while read() reads from the console.

Select an option to see the answer and solution.

Which among the following methods are used to write characters to a string?

Select an option to see the answer and solution.

The correct method to pass a parameter to an attribute is?

Select an option to see the answer and solution.

Which among the following attempts to read up to count bytes into buffer starting at buffer[offset], returning the number of bytes successfully read?

Select an option to see the answer and solution.

Which method of the character stream class returns the numbers of characters successfully read starting at index?

Select an option to see the answer and solution.

Which method among the following returns the integer if no character is available?

Select an option to see the answer and solution.

Choose the correct statement about the WriteLine()?

Select an option to see the answer and solution.

Select the method which returns the number of bytes from the array buffer:

Select an option to see the answer and solution.

Which of these classes is used to create an object whose character sequence is mutable?

Select an option to see the answer and solution.

What will be the output of the following C# code?
static void Main(string[] args)
{
    Console.WriteLine("This is a Console Application:");
    Console.Write("Please enter your lucky number:");
    string val1 = Console.ReadLine();
    int val2 = System.Convert.ToInt32(val1, 10);
    val2 = val2 * val2;
    Console.WriteLine("square of number is:" +val2);
    Console.Read();
}

Select an option to see the answer and solution.

Which of these classes are used by Byte streams for input and output operation?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Select the namespace on which the stream classes are defined?

Select an option to see the answer and solution.