Mrm2299

Cambio de variables

Apr 2nd, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void triple(int*,int*,int*);
  4. main()
  5. {
  6.     int a=10,b=3,c=15;
  7.     triple(&a,&b,&c);
  8.     printf("a=%d  b=%d  c=%d",a,b,c);
  9. }
  10.  
  11.  
  12.  
  13. void triple( int*o,int*p, int*q)
  14. {
  15.     int z=*o;
  16.     *o=*p;
  17.     *p=*q;
  18.     *q=z;
  19.    
  20.    
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment