Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void swap(int *x, int *y);
- int main () {
- int a = 100;
- int b = 200;
- printf("Before swap, value of a : %d\n", a );
- printf("Before swap, value of b : %d\n", b );
- swap(&a, &b);
- printf("After swap, value of a : %d\n", a );
- printf("After swap, value of b : %d\n", b );
- return 0;
- }
- void swap(int *x, int *y) {
- *x = 2000;
- *y = 2000;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment