Adding swap

This commit is contained in:
Scott C. MacCallum 2023-01-13 09:14:28 -05:00
parent e30ff6770e
commit 1ac5356a52
1 changed files with 21 additions and 0 deletions

21
swap.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
void swap(int a, int b) {
int t = a;
a = b;
b = t;
printf("swap: a = %d, b = %d\n",a,b);
}
int main(void) {
int a = 21;
int b = 17;
printf("main: a = %d, b = %d\n",a,b);
swap(a, b);
return 0;
}