CSharp examples for System:Math Number
get Fibonacci Number
using System;//from ww w .j ava 2 s . c o m public class Main{ public static int getFibonacciNumber(int n) { if (n <= 0) { return 0; } if (n == 1) { return 1; } if (n == 2) { return 2; } return getFibonacciNumber(n - 2) + getFibonacciNumber(n - 1); } }