Microsoft
98-372 · Question #175
You want to insert a new line on the console. Which three code fragments will display "Hello" followed by a new line? (Each correct answer presents a complete solution. Choose three.)
The correct answer is A. Console.Write("Hello\n") C. Console.WriteLine("Hello") E. Console.Error.WriteLine("Hello"). \n adds a newline. - Console.Error.WriteLine writes a newline. - Console.WriteLine writes a newline. - : \t is just a space
Understanding .NET Framework Concepts
Question
You want to insert a new line on the console. Which three code fragments will display "Hello" followed by a new line? (Each correct answer presents a complete solution. Choose three.)
Options
- AConsole.Write("Hello\n")
- BConsole.Error.Write("Hello\t")
- CConsole.WriteLine("Hello")
- DConsole.Write("Hello\t")
- EConsole.Error.WriteLine("Hello")
How the community answered
(30 responses)- A83% (25)
- B10% (3)
- D7% (2)
Explanation
- \n adds a newline. - Console.Error.WriteLine writes a newline. - Console.WriteLine writes a newline. - : \t is just a space
Topics
#Console.WriteLine#Console.Write#escape sequences#newline character
Community Discussion
No community discussion yet for this question.