← Back to C# Course | Chapter 1: Setup & Basics | Lesson 3 of 7

Hello World प्रोग्राम

Hello World वह पहला program है जो ज़्यादातर लोग लिखते हैं, एक छोटा सा जो बस एक greeting print करता है। यह computer को आपकी पहली wave hello जैसा है, और हर C# program की Main नाम की एक शुरुआती जगह होती है।

In this page:

  1. Hello World
Syntax
csharp
using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("text");
    }
}

Hello World

हर C# program एक class के अंदर Main method में execution शुरू करता है। Console.WriteLine text को standard output पर उसके बाद एक newline के साथ print करता है। यह आपके setup के काम करने की पुष्टि के लिए उपयोग होने वाला traditional पहला program है।

Note: using System; line उस namespace को import करती है जिसमें Console होता है।

उदाहरण: Hello World

markup
using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello, World!");
    }
}
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. Console.WriteLine("Hello"); के आखिर में semicolon भूल जाना, जो एक compile error देता है।
  2. lowercase में console.writeline लिखना, जबकि C# case-sensitive है और नाम Console.WriteLine है।
  3. dotnet run से project को build और run करने के बजाय .cs file को सीधे चलाना।
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.