fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a,b,c,d,e,x1,x2,ans1,ans2;
  5. printf("enter the value of ax^2+bx+c=0");
  6. scanf("%d%d%d",&a,&b,&c);
  7. d=b^2-4*a*c;
  8. e=sqrt(d);
  9. x1=(-b)+e;
  10. x2=(-b)-e;
  11. ans1=x1/(2*a);
  12. ans2=x2/(2*a);
  13. printf("%d%d",ans1,ans2);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
enter the value of ax^2+bx+c=0-10505-10505