Microsoft
98-372 · Question #136
You want to substitute values in a string that is displayed on the console. Which code fragment will display "Hello, World"?
The correct answer is B. Console.WriteLir.e ("Hello, {0}", "World"). See the full explanation below for the reasoning.
Question
You want to substitute values in a string that is displayed on the console. Which code fragment will display "Hello, World"?
Options
- AConsole.WriteLine("Hello, [0]", "World")
- BConsole.WriteLir.e ("Hello, {0}", "World")
- CConsole.WriteLine("Hello, (0)", "World")
- DConsole.WriteLine("Hello, <0>", "World")
How the community answered
(30 responses)- A10% (3)
- B83% (25)
- C3% (1)
- D3% (1)
Community Discussion
No community discussion yet for this question.