Lesson 2: Console.Write & comments
Last lesson WriteLine dropped a line after the text. This time we meet Console.Write, which shows text without dropping a line — that's how you build one line from several pieces. And we add an important tool: comments. A C# comment starts with // (to the end of the line) or is wrapped in /* ... */,
Console.Write is like writing a word on a sign without starting a new line — the next word sticks on. A comment (//) is a sticky note on the code that the computer doesn't read — only we do.
- Console.Write()
- Shows text and stays on the same line — the next output sticks right after.
- line comment //
- Everything after // until the end of the line is a comment that C# ignores.
- block comment /* */
- Text between /* and */ is a comment — it can span several lines.
- why comments
- Comments explain code to humans. They don't change what the program does.