Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void swapThem(int *a, int *b) {
- int aux = *b;
- *b = *a;
- *a = aux;
- }
- int main(int argc, char const *argv[]) {
- int a = 2;
- int b = 5;
- printf("Before: a is %d b is %d\n", a, b);
- swapThem(&a, &b);
- printf("After: a is %d b is %d\n", a, b);
- }
Advertisement
Add Comment
Please, Sign In to add comment