C# Console Lesson 3.1 — First C# Greeting

Lessons → C# Console → Lesson 3.1
C# Console

First C# Greeting

“A professional language. Your first program. Surprisingly simple.”

⏱ About 15 minutes 🛠 Visual Studio Community ⭐ Lesson 1 of 3

What you will have

A C# console program that asks your name and age — then responds with a personalised message and tells you what year you were born.

It runs in a black console window. Clean. Professional. The same kind of program that real software developers write every day.


Before you start — get Visual Studio

You need Visual Studio Community — it’s free.

Go to visualstudio.microsoft.com and download Visual Studio Community. Run the installer and tick “.NET desktop development” then click Install. This is a big download — about 5-10GB. It may take a while.


Video walkthrough

Prefer to watch? Follow along with the full video.

Watch Greg build the first C# greeting program live — copying the prompt, pasting into ChatGPT, creating the project in Visual Studio, running the code, and making the Vibe Tweak. Pause and rewind as many times as you need.

Enjoying the videos? Subscribe on YouTube for every new lesson →


Your prompt

Copy this. Paste it into your AI. Hit Enter.

📋 Your Prompt — Copy Everything Below
Write a C# console application that asks the user for their name and their age. Then print a friendly personalised greeting that includes their name. Calculate what year they were born and print that too. Keep the code simple and beginner friendly with comments explaining each part.
✅ Copied! Now paste it into your AI.

What to do after

Follow these steps exactly.

1
Create a new project in Visual Studio
Open Visual Studio → Create a new project → search Console App → select C# → name it Greeting → Create.
2
Delete the existing code
Select all with Ctrl+A and delete it.
3
Paste the AI code in
Ctrl+V to paste.
4
Press F5 (fn + F5 on some computers) to run
A black console window will open. Type your name when it asks and hit Enter.

🛠️ Didn’t work?

Don’t panic. Here’s exactly what to do:

1 Look at the error list at the bottom of Visual Studio
2 Copy the error message
3 Say: “This didn’t work. Here’s the error: [paste it]. Please fix it.”

Vibe Tweak

Add another question.

Find the section that asks for the user’s name. Add a new line underneath that asks “What is your favourite colour?” and then prints it back in the greeting message.

Your code will look something like this:

Console.WriteLine("What is your name?");
string name = Console.ReadLine();

Console.WriteLine("What is your favourite colour?");
string colour = Console.ReadLine();

Console.WriteLine("Hello, " + name + "! Great to meet you.");
Console.WriteLine("Nice — " + colour + " is a great choice!");

Not sure where to add it? Ask your AI: “Add a question asking for their favourite colour and include it in the greeting.” Paste the updated code back in. Press F5.


Extra Credit

Want to go further?

📋 Extra Credit Prompt
Update the C# greeting program to ask the user 5 questions: name, age, favourite colour, favourite food, and dream job. Then print a fun personalised paragraph using all 5 answers as if writing their biography.
✅ Copied!

Reflection

Before you move on — think about this.

“C# is used to build real professional software — games, apps, enterprise systems. You just wrote your first C# program. Can you find the line that reads what you typed?”

Up next
C# Console Lesson 3.2 — Age Calculator
Type your birthday. Get back your exact age in years, months and days — plus a countdown to your next birthday.
Next Lesson →
Greg the Vibe Coder · gregthevibecoder.com 18 lessons · No account required