Basic
Operators
Control Statement
Loops
Arrays
Constructor and Destructor
overloading and overrideing
Functions
Advanced
Programs
Interview questions
C#, pronounced as C-Sharp, is a programming language developed by Microsoft. It is an object-oriented programming language that is developed as a part of the .Net initiative and designed by Anders Hejlsberg. It is a general-purpose programming language designed for Common Language Infrastructure. There are some standards for designing C#, like the language needs to be modern, general-purpose, and based on OOPS concepts. It should be suitable for deployment in distributed environments etc. Because of this, it was approved by Ecma as an international standard.
C# is widely used in multiple areas, which makes it more popular and in demand. It is used in the area of Game Development because of its features like an object-oriented, automatic garbage collector, etc. It is also used in the area of web development and desktop applications. There are other features of C#, like Integration with windows, properties, and events, Standard library, Indexers, Multithreading, etc., which are the reason for its worldwide popularity.
There are some advantages of C#
C# is used to build various types of applications like
Below is the simple C# code example to print a message
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tutorial
{
class Program
{
static void Main(string[] args) // Main Method
{
Console.WriteLine("This is C# Tutorial"); // Display message
Console.ReadKey();
}
}
}
Explanation:
Using is for including the System namespace, which is basically a collection of classes.
The class consists of methods of the program. The above code consists of the main method, which shows the behavior of the class.
Static is the keyword that is used to tell whether this method is accessible or not without instantiating the class.
Main() method is where the execution starts. Having only one main method in a program that specifies the behavior is mandatory. It is basically an invoked method to execute.
WriteLine() is used to get output. We can write System.Console.WriteLine(), where System is a namespace with class Console, and WriteLine are the methods to display any message of a class.
ReadKey() is held on the screen until a key is pressed.
The output of the above code is:-
It is good to have knowledge of the C language, which will help to understand the basic concepts and syntaxes.
This is for beginners so that they can understand the basics of C# programming and its applications and advantages.
By signing up, you agree to our Terms of Use and Privacy Policy.
By signing up, you agree to our Terms of Use and Privacy Policy.
Excel functions, formula, charts, formatting creating excel dashboard & others
This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy