Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. /*
  2. * c9q5.c
  3. *
  4. * Created on: Nov 22, 2014
  5. * Author: memonick
  6. */
  7.  
  8. #include <stdio.h>
  9.  
  10. void larger_of(double * , double *);
  11.  
  12. int main(void) {
  13. double n1 = 12.4;
  14. double n2 = 13.5;
  15. larger_of(&n1, &n2);
  16. printf("%.1f, %.1f", n1, n2);
  17. return 0;
  18. }
  19.  
  20. void larger_of(double * x, double * y) {
  21. *x > *y ? *y = *x : *x = *y; // This fucker doesn't work
  22. if (*x > *y) { // This one does
  23. *y = *x;
  24. } else {
  25. *x = *y;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement