Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- void swap(int * x, int * y) { // pass by reference
- int pom = *x;
- *x = *y;
- *y = pom;
- }
- int main(int argc, const char * argv[]) {
- int x, y;
- scanf("%d%d", &x, &y);
- swap(&x, &y);
- printf("%d %d\n", x, y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement