C#, Pronounced "see-sharp." is an object-oriented programming language provided by Microsoft and
runs only on the .NET Framework system.
C# is a simple, modern and its curly brace syntax similar to C, C++, Java languages provides great
familiarity with existing programmers. As an object-oriented language, C# supports the concepts of encapsulation, inheritance, and
polymorphism.
It provides benefits in Type-Safety, Garbage Collection, and Versioning. It helps in scale-up of application
design and has good architecture.
C# is used to develop almost all kinds of applications.
- Console applications
- Desktop applications
- Mobile applications
- Web applications
- Web services
- Games Etc.
Simple C# Program:
Let's understand the program:
- The using System; directive references a namespace called System that is provided by the
- Microsoft .NET Framework class library. The using System; declaration tells the program that we are going to use the classes present in System namespace.
- In the MyFirstClass class we defined the Main method. The main method indicates the starting point for running the program. When we run our program, the execution starts at the first line of the Main() method.
- The curly braces {} denotes the beginning and the end of a block of code.
- Console.WriteLine Prints the text "Hello World" as printf() function to print in C language.