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();
}A. hello 6world
B. hello good world
C. hello goodworld
D. None of the above
Select an option to see the answer and solution.
Choose the output returned when read() reads the character from the console?
A. String
B. Char
C. Integer
D. Boolean
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?
A. Console.In
B. Console.Out
C. Console.Error
D. All of the mentioned
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();
}A. Compile time error
B. Code run successfully prints nothing on console
C. Code runs successfully prints input on console
D. Run time error
Select an option to see the answer and solution.
Which of the following statement is correct?
A. reverse() method reverses some characters
B. reverseall() method reverses all characters
C. replace() method replaces all instances of a character with new character
D. replace() method replaces first occurrence of a character in invoking string with another character
Select an option to see the answer and solution.
Choose the object of TextReader class.
A. Console.In
B. Console.Out
C. Console.Error
D. None of the mentioned
Select an option to see the answer and solution.
Which of the following is the correct statement about inspecting an attribute in C#.NET?
A. An attribute can be inspected at link time
B. An attribute can be inspected at design time
C. An attribute can be inspected at run time
D. None of the mentioned
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.
A. False
B. 0
C. -1
D. All of the mentioned
Select an option to see the answer and solution.
Which among the following methods are used to write characters to a string?
A. StreamWriter
B. StreamReader
C. StringWriter
D. None of the mentioned
Select an option to see the answer and solution.
The correct method to pass a parameter to an attribute is?
A. By name
B. By address
C. By value
D. By reference
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?
A. int ReadByte()
B. int Read(byte[] buffer, int offset, int count)
C. Void WriteByte(byte value)
D. None of the mentioned
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?
A. int Read()
B. int Read(char[] buffer, int index, int count)
C. int ReadBlock(char[ ] buffer, int index, int count)
D. none of the mentioned
Select an option to see the answer and solution.
Which method among the following returns the integer if no character is available?
A. int peek()
B. int read()
C. string ReadLine()
D. none of the mentioned
Select an option to see the answer and solution.
Choose the correct statement about the WriteLine()?
A. Can display one or more value to the screen
B. Adds a newline character at the end of the each new output
C. Allows to output data in as many different formats
D. All of the mentioned
Select an option to see the answer and solution.
Select the method which returns the number of bytes from the array buffer:
A. void WriteByte(byte value)
B. int Write(byte[] buffer, int offset, int count)
C. write()
D. none of the mentioned
Select an option to see the answer and solution.
Which of these classes is used to create an object whose character sequence is mutable?
A. String()
B. StringBuilder()
C. String() & StringBuilder()
D. None of the mentioned
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();
}A. Compile time error
B. Runs successfully does not print anything
C. Runs successfully, ask for input and hence displays the result
D. Syntax Error
Select an option to see the answer and solution.
Which of these classes are used by Byte streams for input and output operation?
A. InputStream
B. InputOutputStream
C. Reader
D. All of the mentioned
Select an option to see the answer and solution.
Which among the following is used for storage of unmanaged memory aspects?
A. BufferedStream
B. FileStream
C. MemoryStream
D. UnmanagedMemoryStream
Select an option to see the answer and solution.
Select the namespace on which the stream classes are defined?
A. System.IO
B. System.Input
C. System.Output
D. All of the mentioned
Select an option to see the answer and solution.