This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A user types 42 when a program runs string answer = Console.ReadLine();. What kind of value does answer hold?
42
string answer = Console.ReadLine();
answer
The text "42".
"42"
The whole number 42.
A number or text, depending on what the user types.
The variable name holds the text Sam. Which line displays Hello, Sam! in the console?
name
Sam
Hello, Sam!
Console.WriteLine($"Hello, {name}!");
Console.WriteLine("Hello, {name}!");
Console.WriteLine("Hello, ", name, "!");
What is wrong with this line of code? Console.WriteLine("What is wrong with me?")
Console.WriteLine("What is wrong with me?")
The L in WriteLine should be lower-case.
L
WriteLine
It's missing a semi-colon at the end
The string should use single-quotes.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?