View Code of Problem 42

#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;
int main( )
{
    float a;
    float b;
    float c;

    cin >> a>> b>> c;

    float d = b*b-4*a*c;
    float e =sqrt(d);

    cout << fixed <<setprecision(2) << (-b+e)/2*a<< " " ;
    cout << fixed <<setprecision(2) << (-b-e)/2*a <<endl ;

    return 0;
}

Double click to view unformatted code.


Back to problem 42