Pointer Solution
Pointer 4. Write a program to swap any two number using call by reference. #include <stdio.h> void swap(int *a, int *b); int main() { int x, y; printf("Enter two integers: "); scanf("%d %d", &x, &y); printf("Before swapping: x = %d, y = %d\n", x, y); swap(&x, &y); printf("After swapping: x = %d, y = %d\n", x, y); return 0; } void swap(int *a, int *b) { int temp; temp = *a; *a = *b; *b = temp; } Output Enter two integers: 2 7 Before swapping: x = 2, y = 7 After swapping: x = 7, y = 2 To run program please click me. 3. Write a program to swap two integer numbers using pointer. #include <stdio.h> void swap(int *a, int *b); int main() { int x, y; printf("Enter two integers: "); scanf("%d %d", &x, &y); printf("Before swapping: x = %d, y = %d\n", x, y); ...