value() public method

public value ( ) : int
return int
Example #1
0
    public int value()
    {
        if(_value <= 2)
            return 1;

        Fib f1 = new Fib(_value - 1);
        Fib f2 = new Fib(_value - 2);

        return f1.value() + f2.value();
    }
Example #2
0
    public int value()
    {
        if (_value <= 2)
        {
            return(1);
        }

        Fib f1 = new Fib(_value - 1);
        Fib f2 = new Fib(_value - 2);

        return(f1.value() + f2.value());
    }
Example #3
0
    public static void Main()
    {
        Fib x = new Fib(40);

        Console.WriteLine(x.value());
    }
Example #4
0
 public static void Main()
 {
     Fib x = new Fib(40);
     Console.WriteLine(x.value());
 }