nerdexam
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)
  • A
    10% (3)
  • B
    83% (25)
  • C
    3% (1)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice