Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  а
Language: C/C++
Code:
#include <math.h>
#include <stdio.h>

int main()
{   int a, b, c, D, x1, x2;
   scanf("%dn",&a);
   scanf("%dn",&b);
   scanf("%d",&c);
   D = b*b - 4*a*c;
   if(D < 0){
    return 0;
            }
   if(D == 0){
    x1 = (-b)/2*a;
    printf("%d",x1);
   }
   if(D > 0)
    x1 = (-sqrt(D) - b)/(2*a);
    x2 = (sqrt(D) - b)/(2*a);
   printf("%d",x1);
   printf("%d",x2);

    return 0;
}

          
Comments: