fork(2) download
  1. #include <stdio.h>
  2. #include <complex.h>
  3.  
  4. int main() {
  5. double x = 1.0;
  6. double y = 2.0;
  7. double complex z = x + y * I;
  8. printf("%.2f %+.2fi\n", creal(z), cimag(z));
  9. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
1.00 +2.00i