printf("\nBefore swapping %d was a and %d was b");

// ...

printf("\n%d is a and %d is b");


You are not passing variables to your "printf()" calls to match the format specifiers.