nerdexam
GIAC

GSSP-NET · Question #471

You work as a Software Developer for ManSoft Inc. You create an application using Visual Studio .NET 2005. You write the following code snippet in the application: int amt = 50; String s = "John…

The correct answer is B. "John gave me 50 dollars". See the full explanation below for the reasoning.

Question

You work as a Software Developer for ManSoft Inc. You create an application using Visual Studio .NET 2005. You write the following code snippet in the application:

int amt = 50; String s = "John gave me " + amt + " dollars"; Console.WriteLine(s); What will be the output of the above code?

Options

  • A"John gave me amt dollars"
  • B"John gave me 50 dollars"
  • CInteger variable cannot concatenate with the string
  • DInvalid type cast exception

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    74% (20)
  • C
    15% (4)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice