Hey! So I wrote this code:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a,b,c;
double x1,x2,delta;
cin>>a;
cin>>b;
cin>>c;
delta=b*b-4*a*c;
x1=(-b+sqrt(delta))/(2*a);
x2=(-b-sqrt(delta))/(2*a);
cout<<"x1="<<x1<<"x2="<<x2;
}
For some reason it only outputs "nan". Any ideas why? I tried with many inputs.