Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. void switcheroo(double *x, double *y);
  3. int main()
  4. {
  5.     double a = 67.8889939993;
  6.     double b = 40.747474788292;
  7.     printf("before switch %d, %d\n", a, b);
  8.     switcheroo(&a, &b);
  9.     printf("this is value switched %d, %d\n", a, b);
  10.  
  11. }
  12. void switcheroo(double *a, double *b)
  13. {
  14.     double temp;
  15.     temp = *a;
  16.     *a = *b;
  17.     *b = temp;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement