C Programming Language
C Programming Language
C# syntax is similar to C, C++, and Java. This makes it • Uses curly braces `{}` to define code blocks.
familiar to many developers. It's a case-sensitive language. • Statements end with semicolons `;`.
Example: Console.WriteLine("Hello, World!");
Key Features of C#
Object-Oriented Type Safety Memory Management
C# supports OOP principles: Strong static typing prevents Automatic garbage collection
encapsulation, inheritance, runtime errors. This leads to more manages memory efficiently. This
polymorphism. These principles robust and predictable reduces the risk of memory leaks.
promote code reusability and applications.
maintainability.
C# and .NET
CLR
CIL is executed by the Common
Language Runtime (CLR).
Practical Applications of C#
Desktop Apps Web Applications
WPF and WinForms are used for Windows desktop ASP.NET and ASP.NET Core are used for web
applications. development.
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}