×

c# · level 1 · unit 2 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

lets your program ask a question.

So far your programs only talk. To listen, they need : whatever the person types. Console.ReadLine() waits while they type an answer and press Enter.

It gives back what they typed as a string, so catch it in a box: string snack = Console.ReadLine();. Then use the box like any other.

Ask the question first with Console.Write, not WriteLine, so the answer is typed on the same line. Leave a space at the end of the question, inside the quotes.

Your program pauses at Console.ReadLine() until the person presses Enter.