At the cinema Mia has seat 7 and Leo seat 12, and they want to swap. Finish swap(a, b) so the two numbers a and b point to trade places. The old *a is already saved in tmp.
Mia: 12, Leo: 7
#include <stdio.h>
void swap(int *a, int *b) {
int tmp = *a;
// your code here: put *b into *a, then tmp into *b
}
int main(void) {
int mia = 7, leo = 12;
swap(&mia, &leo);
printf("Mia: %d, Leo: %d\n", mia, leo);
return 0;
}
Run tries the examples. When they look right, Submit.