Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void swap(int *a, int *b) {
- int temp = 0;
- temp = *a;
- *a = *b;
- *b = temp;
- }
- int main(int argc, char *argv[]) {
- system("color f0");
- int a = 10, b = 35;
- printf("a = %d, b = %d\n", a, b);
- swap(&a, &b);
- printf("swap two variable.\n");
- printf("a = %d, b = %d\n", a, b);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement