C#
Mono C#
Installation
Ubuntu
apt install mono-core
Alma Linux
dnf install mono-core
Arch Linux
pacman -S mono
Examples
Fibonacci Numbers
// Fibonacci Numbers
using System;
class Fibonacci
{
static long Fib(int n)
{
if (n < 2)
return n;
else
return Fib(n - 2) + Fib(n - 1);
}
static void Main(string[] args)
{
int n = int.Parse(args[0]);
Console.Write(Fib(n));
}
}
/*
example
compile:
mcs -optimize+ fib_cs.cs
run:
./fib_cs.exe 39
*/