Complete the code to read a line of input from the user.
string userInput = Console.[1]();The method Console.ReadLine() reads a full line of input from the user as a string.
Complete the code to prompt the user and read their input.
Console.Write("Enter your name: "); string name = Console.[1]();
After prompting the user, Console.ReadLine() reads the input as a string.
Fix the error in the code to correctly read user input as a string.
string input = Console.[1];The method Console.ReadLine() must be called with parentheses to execute and return the input string.
Fill both blanks to read an integer input from the user.
Console.Write("Enter a number: "); int number = int.[1](Console.[2]());
Use Console.ReadLine() to get input as string, then int.Parse() to convert it to an integer.
Fill all three blanks to safely read an integer input using TryParse.
Console.Write("Enter your age: "); string input = Console.[1](); if (int.[2](input, out int [3])) { Console.WriteLine($"Your age is {age}"); } else { Console.WriteLine("Invalid input."); }
Use Console.ReadLine() to get input, then int.TryParse() to safely convert it. The variable age stores the parsed integer.