Member-only story

C# Blog Series 1: Getting Started with Your First C# Program

Ninad K
3 min readFeb 8, 2025

Introduction

C# is a powerful, object-oriented programming language developed by Microsoft, widely used for developing desktop, web, and mobile applications. In this guide, we’ll walk through creating and executing a basic C# program with an interactive twist.

Learn C# the Interactive Way! 🚀 Code, Collect Input, and Tell Stories with Console Applications.

Your First C# Program

Traditionally, the first program beginners write is “Hello World.” However, let’s make it more engaging by creating a personalized greeting program.

Code Example: A Personalized Greeting

using System;
class GreetingApp
{
static void Main()
{
Console.Write("Enter your name: ");
string userName = Console.ReadLine();
Console.Write("Enter your favorite programming language: ");
string favoriteLanguage = Console.ReadLine();
Console.WriteLine("\\nHello, " + userName + "! You love " + favoriteLanguage + ", that's awesome!");
}
}

Explanation of Code:

  1. Using System; → This imports basic functions, including Console.ReadLine() and Console.WriteLine().
  2. Console.Write() → Displays a prompt to take user input on the same line.
  3. Console.ReadLine() → Captures input from…

--

--

No responses yet