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)- A4% (1)
- B74% (20)
- C15% (4)
- D7% (2)
Community Discussion
No community discussion yet for this question.