Guest User

Untitled

a guest
Oct 30th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct complexTag complex;
  5.  
  6. struct complexTag {
  7. double re;
  8. double im;
  9. };
  10.  
  11. complex add(complex z1, complex z2) {
  12.  
  13. return z1 + z2;
  14. }
  15.  
  16. int main(void) {
  17. complex suma(z1,z2);
  18. z1.re = 1;
  19. z1.im = 2;
  20. z2.re = 2;
  21. z2.im = 3;
  22.  
  23. printf("z1 + z2 = %lf + %lf + (%lf + %lf)i",z1.re,z2.re,z1.im,z2.im);
  24.  
  25. system("pause");
  26. return 0;
  27. }
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment