C# was originally designed by Microsoft as an application development language and thus has many features in common with Java. It is now standardised and there are several implementations that run on a variety of platforms. C# is a statically typed imperative programming language with both functional and object oriented features.
Here is an example of the 100 doors problem:
using System;
class Program
{
static void Main()
{
// Initialize a vector of n boolean values
bool[] doors = new bool[100];
// Process the doors
for (int pass = 0; pass < 100; pass++)
for (int current = pass; current < 100; current += pass+1)
doors[current] = !doors[current];
// Print out the results
for (int i = 0; i < 100; i++)
Console.WriteLine("Door #{0} " + (doors[i] ? "Open" : "Closed"), i);
}
}
C# is a modern, fully featured programming language. It is built on top of the CLR which provides a wide range of APIs from 3D graphics to databases.
Specifically, using Mono.NET it is possible to develop cross-platform desktop applications, web applications and games.