My Report

C# I/O Operation Test – 3


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Which of the following statement is correct?

2. What will be the output of the following C# code snippet?

 static void Main(string[] args)
 {
     Console.Write("c");
     Console.Write("sharp" );
     Console.ReadLine();
 }

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

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

5. Choose the correct statement about the WriteLine()?

6. Select the method used to write single byte to a file?

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

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

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

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

 

Start practicing “1000 MCQs on C#”, and once you are ready, you can take tests on all topics by attempting our “C# Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.