C Introduction
C Introduction
C Introduction
Brief History C#
C# syntax
of C# introduction
C#
C# output
comments
Brief History of C#
C# is an object-oriented programming language
provided by Microsoft that runs on .Net Framework. It is
used to develop web apps, desktop apps, mobile apps,
games and much more.
C# is pronounced "C-Sharp".
The first version was released in year 2002. The latest version,
C# 12, was released in November 2023.
C# Install
Create a new project
Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}
C# Output
To output values or print text in C#, you can use the WriteLine()
method:
Example:
Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}
Other Examples:
C# Output
You can also output numbers, and perform mathematical
calculations:
Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}
Single-line Comments
Single-line comments start with two forward slashes (//).
Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}
Any text between // and the end of the line is ignored by C# (will
not be executed).
Create a n
C# Multi-line Comments
Multi-line comments start with /* and ends with
*/.
Any text between /* and */ will be ignored by
C#. Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}