2010-06-17 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / benchmark / fib.cs
blob44c398493f6c359e02c3be359ea957d0bb98d76d
1 using System;
3 public class Fib {
5 public static int fib (int n) {
6 if (n < 2)
7 return 1;
8 return fib(n-2)+fib(n-1);
10 public static int Main (string[] args) {
11 int repeat = 1;
13 if (args.Length == 1)
14 repeat = Convert.ToInt32 (args [0]);
16 Console.WriteLine ("Repeat = " + repeat);
18 for (int i = 0; i < (repeat * 50); i++)
19 if (fib (32) != 3524578)
20 return 1;
22 return 0;