1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
11 protected object Fibonacci(object num
, object flag
)
14 return Fibonacci2(num
, flag
);
15 if (((int)num
% 2) == 0)
16 return Fibonacci2(num
, flag
);
17 return Fibonacci2(num
, flag
);
20 protected object Fibonacci2(object num
, object flag
)
26 N
= (int)Fibonacci((int)num
- 2, false) + (int)Fibonacci((int)num
- 1, flag
);
28 Console
.Write(N
.ToString() + " ");
32 private static int Main()
34 new Test().Fibonacci(20, true);
36 Console
.WriteLine("*** PASSED ***");