Recursive calculation Fibonacci number, e.g. 30 calculates the following number (1, 1, ...)
1 public class MainClass 2 { 3 public static void Main() 4 { 5 Console.WriteLine(Foo(30)); 6 } 7 8 public static int Foo(int i) 9 { 10 if (i <= 0) 11 return 0; 12 else if(i > 0 && i <= 2) 13 return 1; 14 else return Foo(i -1) + Foo(i - 2); 15 } 16 }