#include <stdio.h>

#include <math.h>

main()

{

    float A, B, C, D, XI, XR, X1, X2;

    printf("DAME A, B, Y C \n");

    scanf("%f, %f, %f", &A, &B, &C);

    D = B * B - 4 * A * C;

    if (D < 0)

       {

        XR = -(B) / (2 * A);

          D=D*(-1);

        XI = sqrt(D) / (2 * A);

        printf("X1= %f + %f i\n", XR, XI);

        printf("X2= %f - %f i\n", XR, XI);

       }

    else

       {

        X1 = (-B + sqrt(D)) / (2 * A);

        X2 = (-B - sqrt(D)) / (2 * A);

        printf("X1= %f \n", X1);

        printf("X2= %f \n", X2);

       }

   return 0;

}

 

 

Hosted by www.Geocities.ws

1