BCA / B.Tech 12 min read

Introduction of C# in .NET

Introduction of C# in .NET in Hindi | C# in the .NET Framework in Hindi:


  • C# is a very popular and useful programming language that enables full use of the power of the .NET Framework.
  • Its simplicity, flexibility, and functionality make it ideal for everyone from beginners to professional developers.
  • Using C# with the .NET Framework, developers can easily create modern and scalable applications.
  • C# (C sharp) is a modern, simple, and object-oriented programming language developed by Microsoft.
  • It was launched in the 2000s as part of the .NET Framework.
  • This language is specially designed to provide an easy and powerful programming experience for the user.
  • C# has elements of languages like Java and C++, which makes it easy for developers to learn and use.
Introduction of C# in .NET in Hindi

What is C# (C-Sharp) in Hindi | What is C# (C-Sharp)?

  • C# (C-Sharp) is a modern, object-oriented programming language developed by Microsoft with the .NET Framework.
  • C# gets inspiration from programming languages like C and C++, but it is more secure and user-friendly.
  • It is mainly used for Windows applications, web development, and game development (in Unity).
  • The main purpose of C# is to give developers a simple and easy-to-understand language to work on a secure, fast, and powerful platform.

There are many features in C#, such as:

  • Object-Oriented Programming (OOP)
  • Automatic garbage collection (memory management)
  • Strongly typed language (correct use of data types)
  • Rich class libraries (a large library that makes work easy)
  • C# is mainly used in the .NET Framework and .NET Core.
  • The .NET Framework is a platform that is used to create web applications, desktop applications, mobile applications, etc.

Main Features C# (C-Sharp) in .NET in Hindi | Main features of C#:

  • Easy and readable: The syntax of C# is simple and easy to understand, which makes it suitable for new programming learners.
  • Object-oriented: This language fully supports all the principles of object-oriented programming (OOP) such as encapsulation, inheritance, and polymorphism.
  • Multi-platform support: C# runs on both .NET Core and .NET Framework, so it can be used on Windows, Linux, and Mac.
  • Security and stability: C# has features like Type Safety and automatic garbage collection, which make the code more secure and stable.
  • Integration: C# can be easily integrated with other .NET languages and libraries.
A simple program in C# (Welcome.cs):

Now we will write a very simple program in C# whose purpose is to display "Welcome to C#" on the screen. We will save it as "Welcome.cs".

// Welcome.cs
using System;

class Program
{
    static void Main()
    {
        // This line will print "Welcome to C#" on the screen
        Console.WriteLine("Welcome to C#");
    }
}

Explanation of this program:

using System; // This line imports the namespace named System into the program. This namespace contains all the useful classes and methods that we will use in this program.//

class Program  // This is a main class of C#. In C#, programs are always inside some class. Program is the class in this example that has the main function (Main method).//

static void Main() // The Main() method is the entry point of a C# program, from where the execution of the program starts. static means that this method can be called without any particular instance (object) of the class. void means that this method does not return any value.//

Console.WriteLine("Welcome to C#"); //This line is responsible for displaying the message "Welcome to C#" on the screen. Console.WriteLine is a method that outputs text to the terminal or console.//

Output of this program:

Welcome to C#

Uses of C# in the .NET Framework:

  • Windows applications: C# is used to create Windows Forms and WPF applications.
  • Web applications: Powerful and dynamic websites are created using C# with ASP.NET.
  • Game development: High-quality games are created using C# with the Unity engine.
  • Cloud computing: Cloud-based applications are developed using C# with Azure.
How does C# run?

  • First, the C# code is written as "source code".
  • Then it is compiled with a C# compiler (like csc), which converts it into an executable code that you can run on your machine.
  • When you run it, the program gives you the output.
  • This was an example of a simple program in C#. C# is used for many things, such as desktop applications, web applications, game development, and much more.