Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 18th, 2010 | Syntax: C | Size: 0.24 KB | Hits: 41 | Expires: Never
Copy text to clipboard
  1. #include <stdio.h>
  2.  
  3. void troca(double x,double y)
  4. {
  5.         double temp;
  6.         temp = x;
  7.         x = y;
  8.         y = temp;
  9. }
  10.  
  11. int main()
  12. {
  13.         double x=1.0,y=2.0;
  14.         printf("x=%f y=%f\n",x,y);
  15.         troca(x,y);
  16.         printf("x=%f y=%f\n",x,y);
  17.         return 0;
  18. }