cout << "We are going to calculate the roots of ax^2 + bx +c using the quadratic equation";
cout << "to begin, enter values for a, b, c, and x.";
cout << "\na = " <<flush;
cin >> a;
cout <<"b = " <<flush;
cin >> b;
cout << "c = " <<flush;
cin >> c;
cout << "We will treat the discriminant, b^2-4ac, to be zero if |b^2-4ac| < t, where t";
cout << "\nis the tolerance value, enter a value for t. Then enter the number of decimal";
cout << "\nplaces you want for the answers.";
cout <<"\nt = ";
cin >> t;
cout << "Number of decimal places = ";
cin >> dec;
disc = (b*b - 4*a*c);
Is it a compiling error? Execution error? Something else?
Not sure if this is the error you are talking about, but I notice you handle the tolerance wrong. tolerance will be a positive number; it is simply a magnitude for how much error you are willing to accept. I don't see why you are manipulating it by negating it. And the discriminant should simply be compared to 0, to see if it is positive, negative or zero. Not sure why you are comparing it to tol at all.
Also, you cout a statement that the user should enter values for a, b, c, and x. But there is no x variable ever declared or used in the program.
Also, your complex roots will not be displayed correctly. Your roots are displayed as purely complex numbers. For example, instead of displaying 1+3i and 1-3i you display 4i and -2i. You need to display first the real part, then the imaginary part, and then the letter "i"