#include <stdio.h>
#include <complex.h>
int main(void)
{
double complex x = csqrt(-4);
printf("Square root of -4 is %.1f%+.1fi\n", creal(x), cimag(x));
double complex y = csqrt(9);
printf("Square root of 9 is %.1f%+.1fi\n", creal(y), cimag(y));
return 0;
}
/*
run:
Square root of -4 is 0.0+2.0i
Square root of 9 is 3.0+0.0i
*/