public class Algoritma : MonoBehaviour
{
public int a,b,c;
int d;
float x1, x2;
void Start()
{
Debug.Log("a,b,c değerlerini giriniz");
if(a == 0)
{
Debug.Log("a değerini başka değer giriniz.");
}
else
{
d = (b * b) - (4 * a * c);
Debug.Log(d);
}
if(d > 0)
{
x1 = -b + Mathf.Sqrt(d) / 2*a;
Debug.Log(x1);
x2 = -b - Mathf.Sqrt(d) / 2*a;
Debug.Log(x2);
}
else if (d == 0)
{
x1 = -b / 2 * a;
x2 = -b / 2 * a;
Debug.Log(x1);
Debug.Log(x2);
}
else if(d < 0)
{
Debug.Log("denklemin reel kökü yoktur.");
}
}
}