fork download
  1. #include <complex.h>
  2.  
  3. int main() {
  4. complex double z = 2.7 + 3.4*I;
  5. complex double w = 4.5 - 1.7*I;
  6. complex double t = z*w;
  7. printf("%g + %gi", creal(t), cimag(t));
  8. }
Runtime error #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
17.93 + 10.71i