int main() { printf("=== Pointer Tests ===\n"); printf("Test 1: Address-of operator (&)\n"); int x = 42; int addr = &x; printf("x = %d\n", x); printf("&x = %d\n", addr); printf("PASS: Address-of operator works\n"); printf("Test 2: Dereference operator (*)\n"); int y = 100; int *ptr = &y; int val = *ptr; printf("y = %d\n", y); printf("*ptr = %d\n", val); printf("PASS: Dereference operator works\n"); printf("Test 3: Modify through pointer\n"); int z = 50; int *p = &z; *p = 75; printf("After *p = 75, z = %d\n", z); printf("PASS: Pointer modification works\n"); printf("Test 4: Multiple pointers\n"); int a = 10; int b = 20; int *pa = &a; int *pb = &b; printf("a = %d, b = %d\n", a, b); printf("*pa = %d, *pb = %d\n", *pa, *pb); int sum = *pa + *pb; printf("*pa + *pb = %d\n", sum); printf("PASS: Multiple pointers work\n"); printf("Test 5: Pointer with arrays\n"); int arr[3]; arr[0] = 1; arr[1] = 2; arr[2] = 3; printf("arr[0] = %d, arr[1] = %d, arr[2] = %d\n", arr[0], arr[1], arr[2]); int *arrptr = &arr; printf("Array base address: %d\n", arrptr); printf("PASS: Pointers with arrays work\n"); printf("\n=== All Pointer Tests Completed ===\n"); return 0; }