Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void larger_of(double *x, double *y);
- int main(void){
- double a=123.0009;
- double b=123.1239;
- double *ptr1, *ptr2;
- ptr1=&a;
- ptr2=&b;
- printf("Originally, a = %f and b = %f.\n", a ,b);
- larger_of(ptr1,ptr2);
- printf("Now, a = %f and b = %f.\n", a, b);
- }
- void larger_of(double *x, double *y){
- if(x<y){
- *y=*x;
- } else{
- *x=*y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement