C99で

#include <stdio.h>
#include <complex.h>

int main(){
  double a,b,c;
  double _Complex root1,root2;

  printf("input : ");
  scanf("%lf %lf %lf",&a,&b,&c);

  if(a==0){
    fprintf(stderr,"first argument should not be zero");
    exit(1);
  }
  
  root1 = (-b+csqrt(b*b-4*a*c))/(2*a);
  root2 = (-b-csqrt(b*b-4*a*c))/(2*a);
  
  printf("%g%+gi,%g%+gi\n",creal(root1),cimag(root1),
         creal(root2),cimag(root2));
  
  return 0;
}