c_programming_language/exercices/pointers/5_2_function_args.c
2026-02-25 23:10:14 +03:00

18 lines
253 B
C

#include <stdio.h>
void swap(int *px, int *py) {
int temp;
temp = *py;
*px = *py;
*px = temp;
}
int main() {
int x,y;
x = 10;
y = 20;
printf("x=%d, y=%d", x, y);
swap(&x, &y);
printf("After swap:");
printf("x=%d, y=%d", x, y);
}