Implementation of Chord Method written in C#.

```IN
-3
0
0.00001
OUT
X: -1 f(x): -2
X: -2 f(x): -1
X: -2.33333333333333 f(x): -0.222222222222222
X: -2.4 f(x): -0.0400000000000003
X: -2.41176470588235 f(x): -0.0069204152249126
X: -2.41379310344828 f(x): -0.0011890606420929
X: -2.41414141414141 f(x): -0.00020406081012081
X: -2.41420118343195 f(x): -3.50127796636679E-05
```
```using System;

// ? 2018 TheFlyingKeyboard and released under MIT License
// theflyingkeyboard.net
namespace Chord_Method_CS
{
class Program
{
static void Main(string[] args)
{
double intervalBegin;
double intervalEnd;
double x;
double precision;

Console.Write("Enter beginning of interval: ");

Console.Write("Enter end of interval: ");

Console.Write("Enter precision of method: ");

if (Function(intervalBegin) * Function(intervalEnd) > 0.0D)
{
Console.Write("Function has same signs at ends of interval");
return;
}

x = (intervalBegin * Function(intervalEnd) - intervalEnd * Function(intervalBegin)) / (Function(intervalEnd) - Function(intervalBegin));
while (Math.Abs(Function(x)) > precision)
{
Console.WriteLine("X: " + x + " f(x): " + Function(x));
if (Function(intervalBegin) * Function(x) < 0)
{
x = (x * Function(intervalBegin) - intervalBegin * Function(x)) / (Function(intervalBegin) - Function(x));
}
else
{
x = (x * Function(intervalEnd) - intervalEnd * Function(x)) / (Function(intervalEnd) - Function(x));
}
}

}

static double Function(double x) //x^2 + 2x -1
{
return x * (x + 2) - 1;
}
}
}
```

C# Chord Method