View Code of Problem 42

#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void)
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    double x1,x2,m,n;
    m = b * b - 4 * a *c;
    m = sqrt((double)m) / (2.0 *a);
    n = (-1.0 * b) / (2.0 * a);
    x1 = n + m;
    x2 = n - m;
    printf("%.2lf %.2lf\n",x1,x2);
    return 0;
}

Double click to view unformatted code.


Back to problem 42