Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * c9q5.c
- *
- * Created on: Nov 22, 2014
- * Author: memonick
- */
- #include <stdio.h>
- void larger_of(double * , double *);
- int main(void) {
- double n1 = 12.4;
- double n2 = 13.5;
- larger_of(&n1, &n2);
- printf("%.1f, %.1f", n1, n2);
- return 0;
- }
- void larger_of(double * x, double * y) {
- *x > *y ? *y = *x : *x = *y; // This fucker doesn't work
- if (*x > *y) { // This one does
- *y = *x;
- } else {
- *x = *y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement