fork(1) download
  1. #include <complex.h>
  2. #include <stdio.h>
  3.  
  4. int main(void) {
  5. complex double x, y, z;
  6. x = 3.14159 - 2 * _Complex_I;
  7. y = 2.71828182 - _Complex_I;
  8. z = x - 2*y; printf("x - 2y = %f%+fi\n", creal(z), cimag(z));
  9. }
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
x - 2y = -2.294974+0.000000i